svn commit: r304646 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Mon Aug 22 22:51:09 UTC 2016


Author: bdrewery
Date: Mon Aug 22 22:51:07 2016
New Revision: 304646
URL: https://svnweb.freebsd.org/changeset/base/304646

Log:
  For 'make <directory>' hook into the all_subdir_<directory> targets.
  
  This fixes parallel build issues when trying to depend on ${SUBDIR}.  An
  example of this in share/i18n/csmapper/Makefile where mapper.dir depends
  on ${SUBDIR} having been traversed and built already.  Before this
  change running make in that directory would build the subdirectories
  twice.  This led to obscure build races.  While reworking that build
  may be possible, the framework should not so easily allow creating such
  problems.
  
  Now depending on <directory> will properly redirect to the
  all_subdir_<directory> target rather than invoking the inline shell.
  
  This also makes 'make -jX <directory>' now respect any
  SUBDIR_DEPEND_<directory> statements when SUBDIR_PARALLEL is defined.
  This is not entirely intended and may be changed later.
  
  MFC after:	2 weeks
  Sponsored by:	EMC / Isilon Storage Division

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

Modified: head/share/mk/bsd.subdir.mk
==============================================================================
--- head/share/mk/bsd.subdir.mk	Mon Aug 22 22:51:04 2016	(r304645)
+++ head/share/mk/bsd.subdir.mk	Mon Aug 22 22:51:07 2016	(r304646)
@@ -122,10 +122,10 @@ _SUBDIR: .USEBEFORE
 	    for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done
 .endif
 
-${SUBDIR:N.WAIT}: .PHONY .MAKE
-	${_+_}@target=all; \
-	    dir=${.TARGET}; \
-	    ${_SUBDIR_SH};
+# Create 'make subdir' targets to run the real 'all' target.
+.for __dir in ${SUBDIR:N.WAIT}
+${__dir}: all_subdir_${DIRPRFX}${__dir} .PHONY
+.endfor
 
 .for __target in ${SUBDIR_TARGETS}
 # Can ordering be skipped for this and SUBDIR_PARALLEL forced?


More information about the svn-src-head mailing list