Compile the kernel under ${BUILDDIR} instead of polluting the source

tree. Unfortunately the latter cannot be completely readonly, because
"config" still depends on the kernel config file being in sys/${ARCH}/conf
(it seems to derive other pathnames from that one).
This commit is contained in:
Luigi Rizzo 2001-10-02 16:53:50 +00:00
parent ab66aa1468
commit d8e39ff94b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84376

View File

@ -10,11 +10,20 @@
# and CONFIG may indicate an alternate config program
SRC?=/usr/src
CONF?=${SRC}/sys/i386/conf
CONFIG?=config
# These 3 variables determine where the kernel is built.
# If config were smart enough, we could even place the config
# file in some other place than ${SRC}/sys/i386/conf, but
# at the moment (Oct.2001) this is not possible yet.
CONF=${SRC}/sys/i386/conf
#CONF=${BUILDDIR}/conf # XXX does not work yet
CONFFILE=PICOBSD-${name}
COMPILE=${CONF}/../compile/${CONFFILE}
# We can, however, compile the kernel somewhere else
#COMPILE=${CONF}/../compile/${CONFFILE}
COMPILE=${BUILDDIR}/${CONFFILE}
KERNFILE=${COMPILE}/kernel
${BUILDDIR}/kernel: ${KERNFILE}
@ -28,10 +37,11 @@ do_a_make_in_the_kernel_directory_anyways:
(cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES)
${COMPILE}: ${CONF}/${CONFFILE}
(cd ${CONF}; ${CONFIG} ${CONFFILE}; \
(cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \
cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES depend )
${CONF}/${CONFFILE}: PICOBSD
# -mkdir -p ${CONF} # XXX not needed yet.
cp ${.OODATE} ${.TARGET}
if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; fi