Makefile.conf revision 256281
1265055Smarcel# $FreeBSD: stable/10/release/picobsd/build/Makefile.conf 229511 2012-01-04 19:37:25Z luigi $ 2265055Smarcel# 3265055Smarcel# Makefile for building PICOBSD kernels and running crunchgen 4265055Smarcel# 5265055Smarcel# Needs SRC pointing to the source tree, 6265055Smarcel# MY_TREE ponting to my tree 7265055Smarcel# BUILDDIR pointing to the build directory 8284081Smarcel# PICO_OBJ pointing to the object directory 9265055Smarcel# When building a kernel, also need ${name} from the environment 10265055Smarcel# and CONFIG may indicate an alternate config program 11265055Smarcel 12265055SmarcelBINMAKE?=make 13265055SmarcelSRC?=/usr/src 14265055SmarcelCONFIG?=config 15265055SmarcelMODULES?=-DNO_MODULES # do not build them as a default 16265055SmarcelKERNCONF ?= PICOBSD 17265055Smarcel 18265055Smarcel# caller will set MODULES to empty if modules are needed. 19265055Smarcel# Indeed, it can be used to specify other Makefile options as well. 20265055Smarcel 21265055Smarcel# These 3 variables determine where the kernel is built. 22# If config were smart enough, we could place the config 23# file in some other place than ${SRC}/sys/${TARGET_ARCH}/conf, but 24# at the moment (Oct.2001) this is not possible yet. 25CONF=${SRC}/sys/${TARGET_ARCH}/conf 26#CONF=${BUILDDIR}/conf # XXX does not work yet 27CONFFILE=PICOBSD-${name} 28 29# We can, however, compile the kernel somewhere else 30#COMPILE=${CONF}/../compile/${CONFFILE} 31COMPILE=${BUILDDIR}/${CONFFILE} 32 33KERNFILE=${COMPILE}/kernel 34 35${BUILDDIR}/kernel: ${KERNFILE} 36 cp -p ${.OODATE} ${.TARGET} 37 strip ${.TARGET} 38 strip --remove-section=.note --remove-section=.comment ${.TARGET} 39 40${KERNFILE}: ${COMPILE} do_a_make_in_the_kernel_directory_anyways 41 42do_a_make_in_the_kernel_directory_anyways: 43 (cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} ) 44 45${COMPILE}: ${CONF}/${CONFFILE} 46 (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \ 47 cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} depend ) 48 49${CONF}/${CONFFILE}: ${KERNCONF} 50 # -mkdir -p ${CONF} # XXX not needed yet. 51 cp ${.OODATE} ${.TARGET} 52 [ -f PICOBSD.hints ] && cp PICOBSD.hints ${CONF}/ 53 54# This part creates crunch1.conf and crunch.mk from crunch.conf 55${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf 56 -(cd ${BUILDDIR}/crunch ; \ 57 crunchgen -p ${PICO_OBJ} -o -m ${.TARGET} ${.OODATE} ) 58 59${BUILDDIR}/crunch1.conf: ${MY_TREE}/crunch.conf 60 (cd ${BUILDDIR}/crunch ; cat ${.OODATE} | \ 61 sed -e "s@/usr/src@${SRC}@" -e "s+@__CWD__@+${MY_TREE}+" > ${.TARGET} ) 62