2002-05-29 13:56:04 +04:00
|
|
|
# $NetBSD: Makefile.crunch,v 1.10 2002/05/29 09:56:04 lukem Exp $
|
2002-02-03 18:24:43 +03:00
|
|
|
#
|
|
|
|
# Makefile snippet to build a crunchgen(1)ed binary from the provided lists
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Required variables:
|
2002-04-26 19:50:21 +04:00
|
|
|
# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
|
2002-02-03 18:24:43 +03:00
|
|
|
# CRUNCHBIN name of crunchgen(1)ed binary
|
|
|
|
# LISTS list file(s) to use
|
|
|
|
#
|
2002-03-15 01:26:08 +03:00
|
|
|
# Optional variables:
|
2002-05-02 17:16:46 +04:00
|
|
|
# CRUNCHENV environment to pass to crunchgen(1) and when building
|
|
|
|
# the crunched program. [default: SMALLPROG=1]
|
2002-04-02 09:36:23 +04:00
|
|
|
# CRUNCHGEN_FLAGS extra options to crunchgen(1)
|
2002-03-15 01:26:08 +03:00
|
|
|
# DESTDIR destination directory
|
|
|
|
# PARSELISTENV environment variables to set for parselist.awk
|
|
|
|
#
|
2002-05-02 17:16:46 +04:00
|
|
|
# Variables modified by this:
|
|
|
|
|
|
|
|
CRUNCHENV?= SMALLPROG=1
|
2002-03-15 01:26:08 +03:00
|
|
|
|
2002-04-12 05:59:45 +04:00
|
|
|
.include "${DISTRIBDIR}/common/Makefile.parselist"
|
2002-02-03 18:24:43 +03:00
|
|
|
|
|
|
|
${CRUNCHBIN}: ${CRUNCHBIN}.mk ${CRUNCHBIN}.cache ${CRUNCHBIN}.c
|
2002-05-29 13:56:04 +04:00
|
|
|
${CRUNCHENV} ${MAKE} -j 1 -f ${CRUNCHBIN}.mk all
|
2002-02-03 18:24:43 +03:00
|
|
|
|
|
|
|
${CRUNCHBIN}.mk ${CRUNCHBIN}.cache ${CRUNCHBIN}.c: ${CRUNCHBIN}.conf
|
2002-05-02 17:16:46 +04:00
|
|
|
${CRUNCHENV} ${CRUNCHGEN} -f -D ${NETBSDSRCDIR} -L ${DESTDIR}/usr/lib \
|
2002-05-29 13:56:04 +04:00
|
|
|
-q ${CRUNCHGEN_FLAGS} ${.ALLSRC}
|
2002-02-03 18:24:43 +03:00
|
|
|
|
2002-04-12 05:59:45 +04:00
|
|
|
${CRUNCHBIN}.conf: ${LISTS} ${PARSELISTDEP}
|
2002-02-03 18:24:43 +03:00
|
|
|
-rm -f ${.TARGET} ${.TARGET}.tmp
|
2002-04-12 05:59:45 +04:00
|
|
|
${PARSELIST} -v mode=crunch ${LISTS} > ${.TARGET}.tmp \
|
2002-02-03 18:24:43 +03:00
|
|
|
&& mv ${.TARGET}.tmp ${.TARGET}
|
|
|
|
|
2002-02-06 02:16:16 +03:00
|
|
|
CLEANFILES+= ${CRUNCHBIN} ${CRUNCHBIN}.conf ${CRUNCHBIN}.conf.tmp \
|
|
|
|
${CRUNCHBIN}.cache *.o *.cro *.c
|
2002-02-03 18:24:43 +03:00
|
|
|
|
|
|
|
clean cleandir distclean: cleancrunchgen
|
|
|
|
|
|
|
|
.PHONY: cleancrunchgen
|
|
|
|
|
|
|
|
cleancrunchgen:
|
|
|
|
if [ -f ${CRUNCHBIN}.mk ]; then \
|
2002-05-29 13:56:04 +04:00
|
|
|
${MAKE} -j 1 -f ${CRUNCHBIN}.mk clean; \
|
2002-02-03 18:24:43 +03:00
|
|
|
fi
|
2002-02-06 02:16:16 +03:00
|
|
|
rm -f ${CRUNCHBIN}.mk
|