bsd.crunchgen.mk (289737) | bsd.crunchgen.mk (289846) |
---|---|
1################################################################# 2# 3# General notes: 4# 5# A number of Make variables are used to generate the crunchgen config file. 6# 7# CRUNCH_SRCDIRS: lists directories to search for included programs 8# CRUNCH_PROGS: lists programs to be included --- 11 unchanged lines hidden (view full) --- 20# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} 21# will be used to generate a hard link to the resulting binary. 22# Specific links can be suppressed by setting 23# CRUNCH_SUPPRESS_LINK_${NAME} to 1. 24# 25# If CRUNCH_GENERATE_LINKS is set to no, no links will be generated. 26# 27 | 1################################################################# 2# 3# General notes: 4# 5# A number of Make variables are used to generate the crunchgen config file. 6# 7# CRUNCH_SRCDIRS: lists directories to search for included programs 8# CRUNCH_PROGS: lists programs to be included --- 11 unchanged lines hidden (view full) --- 20# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} 21# will be used to generate a hard link to the resulting binary. 22# Specific links can be suppressed by setting 23# CRUNCH_SUPPRESS_LINK_${NAME} to 1. 24# 25# If CRUNCH_GENERATE_LINKS is set to no, no links will be generated. 26# 27 |
28# $FreeBSD: head/share/mk/bsd.crunchgen.mk 289737 2015-10-22 04:52:37Z bdrewery $ | 28# $FreeBSD: head/share/mk/bsd.crunchgen.mk 289846 2015-10-23 19:41:58Z bdrewery $ |
29 30################################################################## 31# The following is pretty nearly a generic crunchgen-handling makefile 32# 33 34CONF= ${PROG}.conf 35OUTMK= ${PROG}.mk 36OUTC= ${PROG}.c --- 8 unchanged lines hidden (view full) --- 45.endif 46CRUNCH_GENERATE_LINKS?= yes 47 48CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h 49 50# Don't try to extract debug info from ${PROG}. 51MK_DEBUG_FILES= no 52 | 29 30################################################################## 31# The following is pretty nearly a generic crunchgen-handling makefile 32# 33 34CONF= ${PROG}.conf 35OUTMK= ${PROG}.mk 36OUTC= ${PROG}.c --- 8 unchanged lines hidden (view full) --- 45.endif 46CRUNCH_GENERATE_LINKS?= yes 47 48CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h 49 50# Don't try to extract debug info from ${PROG}. 51MK_DEBUG_FILES= no 52 |
53# Set a default SRCDIR for each for simpler handling below. 54.for D in ${CRUNCH_SRCDIRS} 55.for P in ${CRUNCH_PROGS_${D}} 56CRUNCH_SRCDIR_${P}?= ${.CURDIR}/../../${D}/${P} 57.endfor 58.endfor 59 |
|
53# Program names and their aliases contribute hardlinks to 'rescue' executable, 54# except for those that get suppressed. 55.for D in ${CRUNCH_SRCDIRS} 56.for P in ${CRUNCH_PROGS_${D}} | 60# Program names and their aliases contribute hardlinks to 'rescue' executable, 61# except for those that get suppressed. 62.for D in ${CRUNCH_SRCDIRS} 63.for P in ${CRUNCH_PROGS_${D}} |
57.ifdef CRUNCH_SRCDIR_${P} | |
58${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile | 64${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile |
59.else 60${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile 61.endif | |
62.if ${CRUNCH_GENERATE_LINKS} == "yes" 63.ifndef CRUNCH_SUPPRESS_LINK_${P} 64LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} 65.endif 66.for A in ${CRUNCH_ALIAS_${P}} 67.ifndef CRUNCH_SUPPRESS_LINK_${A} 68LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${A} 69.endif --- 14 unchanged lines hidden (view full) --- 84 echo libs ${CRUNCH_LIBS} >>${.TARGET} 85.endif 86.ifdef CRUNCH_SHLIBS 87 echo libs_so ${CRUNCH_SHLIBS} >>${.TARGET} 88.endif 89.for D in ${CRUNCH_SRCDIRS} 90.for P in ${CRUNCH_PROGS_${D}} 91 echo progs ${P} >>${.TARGET} | 65.if ${CRUNCH_GENERATE_LINKS} == "yes" 66.ifndef CRUNCH_SUPPRESS_LINK_${P} 67LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} 68.endif 69.for A in ${CRUNCH_ALIAS_${P}} 70.ifndef CRUNCH_SUPPRESS_LINK_${A} 71LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${A} 72.endif --- 14 unchanged lines hidden (view full) --- 87 echo libs ${CRUNCH_LIBS} >>${.TARGET} 88.endif 89.ifdef CRUNCH_SHLIBS 90 echo libs_so ${CRUNCH_SHLIBS} >>${.TARGET} 91.endif 92.for D in ${CRUNCH_SRCDIRS} 93.for P in ${CRUNCH_PROGS_${D}} 94 echo progs ${P} >>${.TARGET} |
92.ifdef CRUNCH_SRCDIR_${P} | |
93 echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} | 95 echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} |
94.else 95 echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} 96.endif | |
97.ifdef CRUNCH_BUILDOPTS_${P} 98 echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ 99 ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} 100.else 101 echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ >>${.TARGET} 102.endif 103.for A in ${CRUNCH_ALIAS_${P}} 104 echo ln ${P} ${A} >>${.TARGET} --- 28 unchanged lines hidden (view full) --- 133 134# Use a separate build tree to hold files compiled for this crunchgen binary 135# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't 136# get that to cooperate with bsd.prog.mk. Besides, many of the standard 137# targets should NOT be propagated into the components. 138.for __target in clean cleandepend cleandir obj objlink 139.for D in ${CRUNCH_SRCDIRS} 140.for P in ${CRUNCH_PROGS_${D}} | 96.ifdef CRUNCH_BUILDOPTS_${P} 97 echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ 98 ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} 99.else 100 echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ >>${.TARGET} 101.endif 102.for A in ${CRUNCH_ALIAS_${P}} 103 echo ln ${P} ${A} >>${.TARGET} --- 28 unchanged lines hidden (view full) --- 132 133# Use a separate build tree to hold files compiled for this crunchgen binary 134# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't 135# get that to cooperate with bsd.prog.mk. Besides, many of the standard 136# targets should NOT be propagated into the components. 137.for __target in clean cleandepend cleandir obj objlink 138.for D in ${CRUNCH_SRCDIRS} 139.for P in ${CRUNCH_PROGS_${D}} |
141.ifdef CRUNCH_SRCDIR_${P} 142__dir= ${CRUNCH_SRCDIR_${P}} 143.else 144__dir= ${.CURDIR}/../../${D}/${P} 145.endif | |
146${__target}_crunchdir_${P}: .PHONY .MAKE | 140${__target}_crunchdir_${P}: .PHONY .MAKE |
147 ${_+_}cd ${__dir} && \ | 141 ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ |
148 ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ 149 DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} 150${__target}: ${__target}_crunchdir_${P} 151.endfor 152.endfor 153.endfor 154 155clean: 156 rm -f ${CLEANFILES} 157 ${_+_}if [ -e ${.OBJDIR}/${OUTMK} ]; then \ 158 ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} \ 159 -f ${OUTMK} clean; \ 160 fi | 142 ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ 143 DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} 144${__target}: ${__target}_crunchdir_${P} 145.endfor 146.endfor 147.endfor 148 149clean: 150 rm -f ${CLEANFILES} 151 ${_+_}if [ -e ${.OBJDIR}/${OUTMK} ]; then \ 152 ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} \ 153 -f ${OUTMK} clean; \ 154 fi |