38 lines
1.0 KiB
Makefile
38 lines
1.0 KiB
Makefile
|
# $NetBSD: Makefile.crunch,v 1.1 2002/02/03 15:24:43 lukem Exp $
|
||
|
#
|
||
|
# Makefile snippet to build a crunchgen(1)ed binary from the provided lists
|
||
|
#
|
||
|
|
||
|
#
|
||
|
# Required variables:
|
||
|
# _SRC_TOP_ top level of src tree (set by <bsd.own.mk>)
|
||
|
# CRUNCHBIN name of crunchgen(1)ed binary
|
||
|
# LISTS list file(s) to use
|
||
|
#
|
||
|
|
||
|
_PARSELIST= ${_SRC_TOP_}/distrib/common/parselist.awk
|
||
|
|
||
|
${CRUNCHBIN}: ${CRUNCHBIN}.mk ${CRUNCHBIN}.cache ${CRUNCHBIN}.c
|
||
|
env SMALLPROG=1 ${MAKE} -f ${CRUNCHBIN}.mk all
|
||
|
|
||
|
${CRUNCHBIN}.mk ${CRUNCHBIN}.cache ${CRUNCHBIN}.c: ${CRUNCHBIN}.conf
|
||
|
env SMALLPROG=1 \
|
||
|
${CRUNCHGEN} -f -D ${_SRC_TOP_} -L ${DESTDIR}/usr/lib ${.ALLSRC}
|
||
|
|
||
|
${CRUNCHBIN}.conf: ${LISTS} ${_PARSELIST}
|
||
|
-rm -f ${.TARGET} ${.TARGET}.tmp
|
||
|
awk -f ${_PARSELIST} -v mode=crunch ${LISTS} > ${.TARGET}.tmp
|
||
|
&& mv ${.TARGET}.tmp ${.TARGET}
|
||
|
|
||
|
|
||
|
clean cleandir distclean: cleancrunchgen
|
||
|
|
||
|
.PHONY: cleancrunchgen
|
||
|
|
||
|
cleancrunchgen:
|
||
|
if [ -f ${CRUNCHBIN}.mk ]; then \
|
||
|
${MAKE} -f ${CRUNCHBIN}.mk clean; \
|
||
|
fi
|
||
|
rm -f ${CRUNCHBIN} ${CRUNCHBIN}.mk ${CRUNCHBIN}.cache \
|
||
|
${CRUNCHBIN}.conf* *.o *.cro *.c
|