diff options
author | marcel <marcel@FreeBSD.org> | 2000-01-09 17:56:40 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-01-09 17:56:40 +0000 |
commit | ab39706a817aca5ec644d198853c39f7ab623084 (patch) | |
tree | bdc8ae987a41ab189e5a914670fd7d84423aae73 | |
parent | 9892c940980bfd15bf19635d6d94825831e9391b (diff) | |
download | FreeBSD-src-ab39706a817aca5ec644d198853c39f7ab623084.zip FreeBSD-src-ab39706a817aca5ec644d198853c39f7ab623084.tar.gz |
Add a buildkernel and an installkernel target. With these targets
users can more easily upgrade.
buildworld now makes usr.sbin/config in bootstrap-tools so that
when you first make buildworld, buildkernel will use config(8)
from the temp. world tree (and of course also the compiler).
Which kernel to built is determined by the KERNEL variable. You
can have as many kernels listed as you like. When a config file
exists for the given MACHINE it will be built. When KERNEL has
not been defined it will be set to "GENERIC GENERIC98".
The first valid kernel named in the list will be used by the
installkernel target.
When NOCLEAN is defined the kernel object directory is *not*
removed by config first. This is in line with normal buildworld
behaviour.
The buildkernel target makes aicasm in sys/dev/aic7xxx first and
unconditionally. This hack allows us to cross-build kernels and
can go away when the problem is solved in a structural way.
-rw-r--r-- | Makefile.inc1 | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 1d34835..4172ea8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -305,6 +305,79 @@ reinstall: .endif # +# buildkernel and installkernel +# +# Which kernels to build and/or install is specified by setting +# KERNEL. 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. +# +# Note that we have to use MACHINE instead of MACHINE_ARCH when +# we're in kernel-land. Since only MACHINE_ARCH is (expected) to +# be set to cross-build, we have to make sure MACHINE is set +# properly. + +KERNEL?= GENERIC GENERIC98 + +# The only exotic MACHINE_ARCH/MACHINE combination valid at this +# time is i386/pc98. In all other cases set MACHINE equal to +# MACHINE_ARCH. +.if ${MACHINE_ARCH} != "i386" || ${MACHINE} != "pc98" +MACHINE= ${MACHINE_ARCH} +.endif + +KRNLSRCDIR= ${.CURDIR}/sys +KRNLCONFDIR= ${KRNLSRCDIR}/${MACHINE}/conf +KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR} + +.if !defined(NOCLEAN) +CONFIGARGS= -r +.endif + +BUILDKERNELS= +INSTALLKERNEL= +.for _kernel in ${KERNEL} +.if exists(${KRNLCONFDIR}/${_kernel}) +BUILDKERNELS+= ${_kernel} +.if empty(INSTALLKERNEL) +INSTALLKERNEL= ${_kernel} +.endif +.endif +.endfor + +# +# buildkernel +# +# Builds all kernels defined by BUILDKERNELS. +# +buildkernel: + @echo + @echo "--------------------------------------------------------------" + @echo ">>> Rebuilding kernel(s)" + @echo "--------------------------------------------------------------" +.for _kernel in ${BUILDKERNELS} + @echo "===> ${_kernel}" + cd ${KRNLCONFDIR}; \ + PATH=${TMPPATH} \ + config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel} + cd ${KRNLOBJDIR}/${_kernel}; \ + MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \ + ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \ + ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} depend; \ + ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} all +.endfor + +# +# installkernel +# +# Install the kernel defined by INSTALLKERNEL +# +installkernel: + cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ + ${WMAKEENV} MACHINE=${MACHINE} ${MAKE} install + +# # update # # Update the source tree, by running sup and/or running cvs to update to the @@ -391,7 +464,8 @@ _strfile= games/fortune/strfile .endif bootstrap-tools: -.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef gnu/usr.bin/bison +.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \ + gnu/usr.bin/bison cd ${.CURDIR}/${_tool}; \ ${MAKE} obj; \ ${MAKE} depend; \ |