Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / release / picobsd / build / Makefile.conf
1 # $FreeBSD: src/release/picobsd/build/Makefile.conf,v 1.5.2.11 2001/11/01 16:27:49 luigi Exp $
2 # $DragonFly: src/release/picobsd/build/Attic/Makefile.conf,v 1.2 2003/06/17 04:27:20 dillon Exp $
3 #
4 # Makefile for building PICOBSD kernels and running crunchgen
5 #
6 # Needs SRC pointing to the source tree,
7 # MY_TREE ponting to my tree
8 # BUILDDIR pointing to the build directory
9 # PICO_OBJ pointing to the object directory
10 # When building a kernel, also need ${name} from the environment
11 # and CONFIG may indicate an alternate config program
12
13 SRC?=/usr/src
14 CONFIG?=config
15 MODULES?=-DNO_MODULES   # do not build them as a default
16
17 # caller will set MODULES to empty if modules are needed.
18 # Indeed, it can be used to specify other Makefile options as well.
19
20 # These 3 variables determine where the kernel is built.
21 # If config were smart enough, we could place the config
22 # file in some other place than ${SRC}/sys/i386/conf, but
23 # at the moment (Oct.2001) this is not possible yet.
24 CONF=${SRC}/sys/i386/conf
25 #CONF=${BUILDDIR}/conf          # XXX does not work yet
26 CONFFILE=PICOBSD-${name}
27
28 # We can, however, compile the kernel somewhere else
29 #COMPILE=${CONF}/../../compile/${CONFFILE}
30 COMPILE=${BUILDDIR}/${CONFFILE}
31
32 KERNFILE=${COMPILE}/kernel
33
34 ${BUILDDIR}/kernel: ${KERNFILE}
35         cp -p ${.OODATE} ${.TARGET}
36         strip ${.TARGET}
37         strip --remove-section=.note --remove-section=.comment ${.TARGET}
38
39 ${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways
40
41 do_a_make_in_the_kernel_directory_anyways:
42         (cd ${COMPILE}; make KERNEL=kernel ${MODULES} )
43
44 ${COMPILE}: ${CONF}/${CONFFILE}
45         (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \
46         cd ${COMPILE}; make KERNEL=kernel ${MODULES} depend )
47
48 ${CONF}/${CONFFILE}: PICOBSD
49         # -mkdir -p ${CONF}             # XXX not needed yet.
50         cp ${.OODATE} ${.TARGET}
51         if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; fi
52
53 # This part creates crunch1.conf and crunch.mk from crunch.conf
54 ${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf
55         -(cd ${BUILDDIR}/crunch ; \
56         crunchgen -p ${PICO_OBJ} -o -m ${.TARGET} ${.OODATE} )
57
58 ${BUILDDIR}/crunch1.conf: ${MY_TREE}/crunch.conf
59         (cd ${BUILDDIR}/crunch ; cat ${.OODATE} | \
60             sed -e "s@/usr/src@${SRC}@" -e "s+@__CWD__@+${MY_TREE}+" > ${.TARGET} )