freebsd-dev/release/picobsd/build/Makefile.conf

56 lines
1.8 KiB
Makefile
Raw Normal View History

1999-08-28 01:35:59 +00:00
# $FreeBSD$
#
# Makefile for building PICOBSD kernels and running crunchgen
#
# Needs SRC pointing to the source tree,
# MY_TREE ponting to my tree
# BUILDDIR pointing to the build directory
# PICO_OBJ pointing to the object directory
# When building a kernel, also need ${name} from the environment
# and CONFIG may indicate an alternate config program
SRC?=/usr/src
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}
# We can, however, compile the kernel somewhere else
#COMPILE=${CONF}/../compile/${CONFFILE}
COMPILE=${BUILDDIR}/${CONFFILE}
KERNFILE=${COMPILE}/kernel
${BUILDDIR}/kernel: ${KERNFILE}
cp -p ${.OODATE} ${.TARGET}
strip ${.TARGET}
strip --remove-section=.note --remove-section=.comment ${.TARGET}
${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways
do_a_make_in_the_kernel_directory_anyways:
(cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES)
${COMPILE}: ${CONF}/${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
# This part creates crunch1.conf and crunch.mk from crunch.conf
${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf
-(cd ${BUILDDIR}/crunch ; \
crunchgen -p ${PICO_OBJ} -o -m ${.TARGET} ${.OODATE} )
${BUILDDIR}/crunch1.conf: ${MY_TREE}/crunch.conf
(cd ${BUILDDIR}/crunch ; cat ${.OODATE} | \
sed -e "s@/usr/src@${SRC}@" -e "s+@__CWD__@+${MY_TREE}@" > ${.TARGET} )