summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2000-01-09 17:56:40 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2000-01-09 17:56:40 +0000
commitf3bb8dbd87ba91b58f3cb2d8d5b87aa067b8abad (patch)
tree2831ffb27e4f5559993270f8e10386719a299e2c /Makefile.inc1
parent66aeaaf280d3cd8b5a1ccef42afe8a23fe18a4bc (diff)
downloadsrc-test-f3bb8dbd87ba91b58f3cb2d8d5b87aa067b8abad.tar.gz
src-test-f3bb8dbd87ba91b58f3cb2d8d5b87aa067b8abad.zip
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.
Notes
Notes: svn path=/head/; revision=55676
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc176
1 files changed, 75 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 1d34835dcb71b..4172ea8bdc2c3 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; \