Date: Mon, 22 Aug 2016 22:51:07 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304646 - head/share/mk Message-ID: <201608222251.u7MMp7UT054384@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608222251.u7MMp7UT054384>