NetBSD/distrib/common/Makefile.crunch
lukem 6276be048b - improve error checking
- add support for passing variables to parselist.awk that are used to replace
  text in each line of the lists.  currently supported strings:
	text		variable
	----		--------
	@MACHINE_ARCH@	MACHINE_ARCH
	@MACHINE@	MACHINE
2002-02-07 11:39:17 +00:00

41 lines
1.1 KiB
Makefile

# $NetBSD: Makefile.crunch,v 1.3 2002/02/07 11:39:17 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 \
MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
${LISTS} > ${.TARGET}.tmp
&& mv ${.TARGET}.tmp ${.TARGET}
CLEANFILES+= ${CRUNCHBIN} ${CRUNCHBIN}.conf ${CRUNCHBIN}.conf.tmp \
${CRUNCHBIN}.cache *.o *.cro *.c
clean cleandir distclean: cleancrunchgen
.PHONY: cleancrunchgen
cleancrunchgen:
if [ -f ${CRUNCHBIN}.mk ]; then \
${MAKE} -f ${CRUNCHBIN}.mk clean; \
fi
rm -f ${CRUNCHBIN}.mk