Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.crunchgen.mk
################################################################# | ################################################################# | ||||
# | # | ||||
# Generate crunched binaries using crunchgen(1). | # Generate crunched binaries using crunchgen(1). | ||||
# | # | ||||
# General notes: | # General notes: | ||||
# | # | ||||
# A number of Make variables are used to generate the crunchgen config file. | # A number of Make variables are used to generate the crunchgen config file. | ||||
# | # | ||||
# CRUNCH_SRCDIRS: lists directories to search for included programs | # CRUNCH_SRCDIRS: lists directories to search for included programs | ||||
# CRUNCH_PROGS: lists programs to be included | # CRUNCH_PROGS: lists programs to be included | ||||
# CRUNCH_LIBS: libraries to statically link with | # CRUNCH_LIBS: libraries to statically link with | ||||
# CRUNCH_SHLIBS: libraries to dynamically link with | # CRUNCH_SHLIBS: libraries to dynamically link with | ||||
# CRUNCH_BUILDOPTS: generic build options to be added to every program | # CRUNCH_BUILDOPTS: generic build options to be added to every program | ||||
# CRUNCH_BUILDTOOLS: lists programs that need build tools built in the | |||||
# local architecture. | |||||
# | # | ||||
# Special options can be specified for individual programs | # Special options can be specified for individual programs | ||||
# CRUNCH_SRCDIR_${P}: base source directory for program ${P} | # CRUNCH_SRCDIR_${P}: base source directory for program ${P} | ||||
# CRUNCH_BUILDOPTS_${P}: additional build options for ${P} | # CRUNCH_BUILDOPTS_${P}: additional build options for ${P} | ||||
# CRUNCH_ALIAS_${P}: additional names to be used for ${P} | # CRUNCH_ALIAS_${P}: additional names to be used for ${P} | ||||
# | # | ||||
# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} | # By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} | ||||
# will be used to generate a hard link to the resulting binary. | # will be used to generate a hard link to the resulting binary. | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | ${CRUNCHENV} \ | ||||
CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ | CXX="${CXX} ${CXXFLAGS} ${LDFLAGS}" \ | ||||
${MAKE} ${CRUNCHARGS} .MAKE.MODE="${.MAKE.MODE} curdirOk=yes" \ | ${MAKE} ${CRUNCHARGS} .MAKE.MODE="${.MAKE.MODE} curdirOk=yes" \ | ||||
.MAKE.META.IGNORE_PATHS="${.MAKE.META.IGNORE_PATHS}" \ | .MAKE.META.IGNORE_PATHS="${.MAKE.META.IGNORE_PATHS}" \ | ||||
-f ${OUTMK} exe | -f ${OUTMK} exe | ||||
objs: ${OUTMK} .META | objs: ${OUTMK} .META | ||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ | ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ | ||||
${MAKE} -f ${OUTMK} ${CRUNCHARGS} BUILD_TOOLS_META=.NOMETA objs | ${MAKE} -f ${OUTMK} ${CRUNCHARGS} BUILD_TOOLS_META=.NOMETA objs | ||||
# <sigh> Someone should replace the bin/csh and bin/sh build-tools with | |||||
# shell scripts so we can remove this nonsense. | |||||
.for _tool in ${CRUNCH_BUILDTOOLS} | |||||
build-tools-${_tool}: | |||||
${_+_}cd ${.CURDIR}/../../${_tool}; \ | |||||
if [ "${MK_AUTO_OBJ}" = "no" ]; then \ | |||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ | |||||
fi; \ | |||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools | |||||
build-tools: build-tools-${_tool} | |||||
.endfor | |||||
# Use a separate build tree to hold files compiled for this crunchgen binary | # Use a separate build tree to hold files compiled for this crunchgen binary | ||||
# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't | # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't | ||||
# get that to cooperate with bsd.prog.mk. Besides, many of the standard | # get that to cooperate with bsd.prog.mk. Besides, many of the standard | ||||
# targets should NOT be propagated into the components. | # targets should NOT be propagated into the components. | ||||
.if ${MK_AUTO_OBJ} == "no" | .if ${MK_AUTO_OBJ} == "no" | ||||
_obj= obj | _obj= obj | ||||
.endif | .endif | ||||
Show All 24 Lines |