svn commit: r289731 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Thu Oct 22 04:28:24 UTC 2015


Author: bdrewery
Date: Thu Oct 22 04:28:22 2015
New Revision: 289731
URL: https://svnweb.freebsd.org/changeset/base/289731

Log:
  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

Modified:
  head/share/mk/bsd.crunchgen.mk

Modified: head/share/mk/bsd.crunchgen.mk
==============================================================================
--- head/share/mk/bsd.crunchgen.mk	Thu Oct 22 03:51:25 2015	(r289730)
+++ head/share/mk/bsd.crunchgen.mk	Thu Oct 22 04:28:22 2015	(r289731)
@@ -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


More information about the svn-src-all mailing list