2002-03-15 01:26:08 +03:00
|
|
|
# $NetBSD: Makefile.crunch,v 1.4 2002/03/14 22:26:09 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:
|
|
|
|
# _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
|
|
|
|
#
|
2002-03-15 01:26:08 +03:00
|
|
|
# Optional variables:
|
|
|
|
# DESTDIR destination directory
|
|
|
|
# PARSELISTENV environment variables to set for parselist.awk
|
|
|
|
#
|
|
|
|
|
|
|
|
PARSELISTENV+= _SRC_TOP_=${_SRC_TOP_:Q} \
|
|
|
|
CRUNCHBIN=${CRUNCHBIN:Q} \
|
|
|
|
CURDIR=${.CURDIR:Q} \
|
|
|
|
DESTDIR=${DESTDIR:Q} \
|
|
|
|
MACHINE=${MACHINE:Q} \
|
|
|
|
MACHINE_ARCH=${MACHINE_ARCH:Q} \
|
|
|
|
OBJDIR=${.OBJDIR:Q}
|
2002-02-03 18:24:43 +03:00
|
|
|
|
|
|
|
_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
|
2002-03-15 01:26:08 +03:00
|
|
|
${PARSELISTENV} awk -f ${_PARSELIST} -v mode=crunch \
|
2002-02-07 14:39:17 +03:00
|
|
|
${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 \
|
|
|
|
${MAKE} -f ${CRUNCHBIN}.mk clean; \
|
|
|
|
fi
|
2002-02-06 02:16:16 +03:00
|
|
|
rm -f ${CRUNCHBIN}.mk
|