1999-08-28 01:35:59 +00:00
|
|
|
# $FreeBSD$
|
1998-09-03 10:41:36 +00:00
|
|
|
#
|
2001-06-21 08:49:46 +00:00
|
|
|
# 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
|
1998-09-03 10:41:36 +00:00
|
|
|
|
|
|
|
SRC?=/usr/src
|
2001-06-21 08:49:46 +00:00
|
|
|
CONF?=${SRC}/sys/i386/conf
|
|
|
|
CONFIG?=config
|
1998-09-03 10:41:36 +00:00
|
|
|
|
2001-04-23 19:55:03 +00:00
|
|
|
CONFFILE=PICOBSD-${name}
|
2001-09-01 21:19:15 +00:00
|
|
|
COMPILE=${CONF}/../compile/${CONFFILE}
|
2001-06-21 08:49:46 +00:00
|
|
|
KERNFILE=${COMPILE}/kernel
|
1998-09-03 10:41:36 +00:00
|
|
|
|
2001-09-04 02:01:52 +00:00
|
|
|
${BUILDDIR}/kernel: ${KERNFILE}
|
|
|
|
cp -p ${.OODATE} ${.TARGET}
|
|
|
|
strip ${.TARGET}
|
|
|
|
strip --remove-section=.note --remove-section=.comment ${.TARGET}
|
1998-09-03 10:41:36 +00:00
|
|
|
|
2001-06-21 08:49:46 +00:00
|
|
|
${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways
|
2000-02-08 08:25:00 +00:00
|
|
|
|
2001-04-23 19:55:03 +00:00
|
|
|
do_a_make_in_the_kernel_directory_anyways:
|
|
|
|
(cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES)
|
2000-02-08 08:25:00 +00:00
|
|
|
|
|
|
|
${COMPILE}: ${CONF}/${CONFFILE}
|
2001-06-21 08:49:46 +00:00
|
|
|
(cd ${CONF}; ${CONFIG} ${CONFFILE}; \
|
2001-04-23 19:55:03 +00:00
|
|
|
cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES depend )
|
2000-02-08 08:25:00 +00:00
|
|
|
|
2001-06-21 08:49:46 +00:00
|
|
|
${CONF}/${CONFFILE}: PICOBSD
|
|
|
|
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 ; \
|
2001-08-30 21:39:14 +00:00
|
|
|
crunchgen -p ${PICO_OBJ} -o -m ${.TARGET} ${.OODATE} )
|
1998-09-03 10:41:36 +00:00
|
|
|
|
2001-06-21 08:49:46 +00:00
|
|
|
${BUILDDIR}/crunch1.conf: ${MY_TREE}/crunch.conf
|
|
|
|
(cd ${BUILDDIR}/crunch ; cat ${.OODATE} | \
|
|
|
|
sed -e "s@/usr/src@${SRC}@" -e "s@CWD@${MY_TREE}@" > ${.TARGET} )
|