Index: Makefile =================================================================== RCS file: /home/ncvs/src/Makefile,v retrieving revision 1.234.2.6 diff -u -r1.234.2.6 Makefile --- Makefile 2000/12/06 06:00:43 1.234.2.6 +++ Makefile 2001/02/02 07:52:12 @@ -9,6 +9,7 @@ # world - buildworld + installworld. # buildkernel - Rebuild the kernel and the kernel-modules. # installkernel - Install the kernel and the kernel-modules. +# reinstallkernel - Reinstall the kernel and the kernel-modules. # kernel - buildkernel + installkernel. # update - Convenient way to update your source tree (cvs). # upgrade - Upgrade a.out (2.2.x/3.0) system to the new ELF way @@ -86,7 +87,8 @@ TGTS= afterdistribute all buildkernel buildworld checkdpadd clean \ cleandepend cleandir depend distribute everything hierarchy includes \ install installkernel installmost installworld kernel libraries lint \ - maninstall mk most obj objlink regress rerelease tags update + maninstall mk most obj objlink regress reinstallkernel rerelease \ + tags update PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.141.2.19 diff -u -r1.141.2.19 Makefile.inc1 --- Makefile.inc1 2001/01/22 23:26:15 1.141.2.19 +++ Makefile.inc1 2001/02/02 07:52:12 @@ -15,6 +15,7 @@ # -DNOLIBC_R do not build libc_r. # -DNO_FORTRAN do not build g77 and related libraries. # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel +# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update @@ -335,7 +336,7 @@ # buildkernel and installkernel # # Which kernels to build and/or install is specified by setting -# KERNEL. If not defined a GENERIC kernel is built/installed. +# KERNCONF. If not defined a GENERIC kernel is built/installed. # Only the existing (depending MACHINE) config files are used # for building kernels and only the first of these is designated # as the one being installed. @@ -345,7 +346,13 @@ # be set to cross-build, we have to make sure MACHINE is set # properly. -KERNEL?= GENERIC +.if !defined(KERNCONF) && defined(KERNEL) +KERNCONF= ${KERNEL} +KERNWARN= yes +.else +KERNCONF?= GENERIC +.endif +INSTKERNNAME?= kernel # The only exotic MACHINE_ARCH/MACHINE combination valid at this # time is i386/pc98. In all other cases set MACHINE equal to @@ -358,13 +365,9 @@ KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR} -.if !defined(NOCLEAN) -CONFIGARGS+= -r -.endif - BUILDKERNELS= INSTALLKERNEL= -.for _kernel in ${KERNEL} +.for _kernel in ${KERNCONF} .if exists(${KRNLCONFDIR}/${_kernel}) BUILDKERNELS+= ${_kernel} .if empty(INSTALLKERNEL) @@ -379,6 +382,15 @@ # Builds all kernels defined by BUILDKERNELS. # buildkernel: +.if empty(BUILDKERNELS) + @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})." + @false +.endif +.if defined(KERNWARN) + @echo "--------------------------------------------------------------" + @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" + @echo "--------------------------------------------------------------" +.endif @echo .for _kernel in ${BUILDKERNELS} @echo "--------------------------------------------------------------" @@ -391,15 +403,19 @@ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel} .endif +.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) cd ${KRNLOBJDIR}/${_kernel}; \ + ${KMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} clean +.endif + cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \ ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile .if !defined(NO_KERNELDEPEND) cd ${KRNLOBJDIR}/${_kernel}; \ - ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel depend + ${KMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} depend .endif cd ${KRNLOBJDIR}/${_kernel}; \ - ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel all + ${KMAKEENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} all @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_TIME=C date`" @echo "--------------------------------------------------------------" @@ -411,8 +427,11 @@ # Install the kernel defined by INSTALLKERNEL # installkernel: + cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ + ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} install +reinstallkernel: cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ - ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=kernel install + ${CROSSENV} MACHINE=${MACHINE} ${MAKE} KERNEL=${INSTKERNNAME} reinstall # # kernel