Makefile.conf revision 84603
1# $FreeBSD: head/release/picobsd/build/Makefile.conf 84603 2001-10-07 00:21:13Z luigi $
2#
3# Makefile for building PICOBSD kernels and running crunchgen
4#
5# Needs SRC pointing to the source tree,
6# MY_TREE ponting to my tree
7# BUILDDIR pointing to the build directory
8# PICO_OBJ pointing to the object directory
9# When building a kernel, also need ${name} from the environment
10# and CONFIG may indicate an alternate config program
11
12SRC?=/usr/src
13CONFIG?=config
14
15# These 3 variables determine where the kernel is built.
16# If config were smart enough, we could place the config
17# file in some other place than ${SRC}/sys/i386/conf, but
18# at the moment (Oct.2001) this is not possible yet.
19CONF=${SRC}/sys/i386/conf
20#CONF=${BUILDDIR}/conf         # XXX does not work yet
21CONFFILE=PICOBSD-${name}
22
23# We can, however, compile the kernel somewhere else
24#COMPILE=${CONF}/../compile/${CONFFILE}
25COMPILE=${BUILDDIR}/${CONFFILE}
26
27KERNFILE=${COMPILE}/kernel
28
29${BUILDDIR}/kernel: ${KERNFILE}
30	cp -p ${.OODATE} ${.TARGET}
31	strip ${.TARGET}
32	strip --remove-section=.note --remove-section=.comment ${.TARGET}
33
34${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways
35
36do_a_make_in_the_kernel_directory_anyways:
37	(cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES)
38
39${COMPILE}: ${CONF}/${CONFFILE}
40	(cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \
41	cd ${COMPILE}; make KERNEL=kernel -DNO_MODULES depend )
42
43${CONF}/${CONFFILE}: PICOBSD
44	# -mkdir -p ${CONF}		# XXX not needed yet.
45	cp ${.OODATE} ${.TARGET}
46	if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; fi
47
48# This part creates crunch1.conf and crunch.mk from crunch.conf
49${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf
50	-(cd ${BUILDDIR}/crunch ; \
51	crunchgen -p ${PICO_OBJ} -o -m ${.TARGET} ${.OODATE} )
52
53${BUILDDIR}/crunch1.conf: ${MY_TREE}/crunch.conf
54	(cd ${BUILDDIR}/crunch ; cat ${.OODATE} | \
55	    sed -e "s@/usr/src@${SRC}@" -e "s+@__CWD__@+${MY_TREE}+" > ${.TARGET} )
56