Clean up some bsd.crunchgen.mk issues.

- Remove handling of 'make -P' since that is for fmake only.
- Add '+' where appropriate for sub-make calls.
- Pass MK_TESTS=no to all of the sub-makes to prevent recursing into test
  directories for targets such as 'obj', 'clean', 'depend', etc.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2015-10-22 04:28:22 +00:00
parent d66e085097
commit a2ebfeb0ad

View File

@ -107,26 +107,27 @@ $(CONF): Makefile
.endfor
CRUNCHGEN?= crunchgen
# XXX Make sure we don't pass -P to crunchgen(1).
.MAKEFLAGS:= ${.MAKEFLAGS:N-P}
CRUNCHENV?= MK_TESTS=no
.ORDER: $(OUTPUTS) objs
$(OUTPUTS): $(CONF) .META
MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq -m $(OUTMK) \
-c $(OUTC) $(CONF)
# These 2 targets cannot use .MAKE since they depend on the generated
# ${OUTMK} above.
$(PROG): $(OUTPUTS) objs
MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe
objs: $(OUTMK)
MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs
# <sigh> Someone should replace the bin/csh and bin/sh build-tools with
# shell scripts so we can remove this nonsense.
build-tools:
.for _tool in $(CRUNCH_BUILDTOOLS)
cd $(.CURDIR)/../../${_tool}; \
MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \
MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools
${_+_}cd $(.CURDIR)/../../${_tool}; \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools
.endfor
# Use a separate build tree to hold files compiled for this crunchgen binary
@ -137,12 +138,12 @@ cleandepend cleandir obj objlink:
.for D in $(CRUNCH_SRCDIRS)
.for P in $(CRUNCH_PROGS_$(D))
.ifdef CRUNCH_SRCDIR_${P}
cd ${CRUNCH_SRCDIR_$(P)} && \
MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
.else
cd $(.CURDIR)/../../${D}/${P} && \
MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
${_+_}cd $(.CURDIR)/../../${D}/${P} && \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
.endif
.endfor
@ -150,18 +151,18 @@ cleandepend cleandir obj objlink:
clean:
rm -f ${CLEANFILES}
if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \
${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \
fi
.for D in $(CRUNCH_SRCDIRS)
.for P in $(CRUNCH_PROGS_$(D))
.ifdef CRUNCH_SRCDIR_${P}
cd ${CRUNCH_SRCDIR_$(P)} && \
MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
.else
cd $(.CURDIR)/../../${D}/${P} && \
MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
${_+_}cd $(.CURDIR)/../../${D}/${P} && \
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
.endif
.endfor