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.
This commit is contained in:
Marcel Moolenaar 2000-01-09 17:56:40 +00:00
parent 66aeaaf280
commit f3bb8dbd87

View File

@ -304,6 +304,79 @@ reinstall:
cd ${.CURDIR}/share/man; ${MAKE} makedb
.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
#
@ -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; \