freebsd-skq/release/picobsd/build/Makefile.crunch
joe 8791fdf576 Post process the crunch1.mk file to allow make arguments to passed on
a per program basis allowing a greater control on what is built.

The buildopts file contains Makefile lines of form:

	# Anything added to OPTS is added to every build rule.
	OPTS= -DNOPAM

	# These should only be added to the build of user-ppp.
	ppp_OPTS= -DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM -DNOSUID \
		-DHAVE_DES -DNORADIUS -DNOI4B -DNONETGRAPH

Really these should be added to crunch.inc, but that file is currently
optional, and if defined masks the global one.  Next step will be to move
these global settings back out into the individual builds as OPTS, and
then migrate OPTS and prog_OPTS back into the local crunch.inc file.
2000-11-02 13:16:43 +00:00

51 lines
1.3 KiB
Makefile

#
# $FreeBSD$
#
SRC?=/usr/src
CRUNCHFLAGS+= -DNOPAM -DRELEASE_CRUNCH -DNOSECURE -DNOCRYPT -DNONETGRAPH -DNOIPSEC
all: crunch
crunch:
@cat crunch.conf|sed -e "s@/usr/src@${SRC}@" >crunch1.conf
@( if [ -f crunch.inc ] ; then \
crunchgen -h ./crunch.inc ./crunch1.conf ; \
else \
crunchgen -h ../../build/crunch.inc ./crunch1.conf ; \
fi )
../../build/munge_crunchmk.pl crunch1.mk ;
@( if [ -f buildopts.inc ] ; then \
echo '.include "buildopts.inc"' > crunch1.mk.tmp ; \
cat crunch1.mk >> crunch1.mk.tmp ; \
mv crunch1.mk.tmp crunch1.mk ; \
fi )
${MAKE} -f crunch1.mk $(CRUNCHFLAGS) all \
"CFLAGS=${CFLAGS} ${CRUNCHFLAGS}" #2>&1 >/dev/null
strip --remove-section=.note --remove-section=.comment crunch1
clean:
rm -f *.o *.stub *.lo *_stub.c *.mk \
crunch.cache \
crunch.mk \
crunch.c \
crunch1* \
crunch \
.tmp_* \
*.gz
install:
cp crunch1 ${MFS_MOUNTPOINT}/stand/crunch
chmod 555 ${MFS_MOUNTPOINT}/stand/crunch
for i in `crunchgen -l crunch1.conf` ; \
do \
ln ${MFS_MOUNTPOINT}/stand/crunch ${MFS_MOUNTPOINT}/stand/$${i}; \
done
rm ${MFS_MOUNTPOINT}/stand/crunch
# Install the MIB files
#mkdir -p ${MFS_MOUNTPOINT}/usr/local/share/snmp/mibs
#cp ../../net/crunch1/mibs/*.txt ${MFS_MOUNTPOINT}/usr/local/share/snmp/mibs/
.include <bsd.prog.mk>