From owner-svn-src-all@freebsd.org Mon Aug 22 22:51:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7B6BC2AB8; Mon, 22 Aug 2016 22:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A08BE1DCE; Mon, 22 Aug 2016 22:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMp72b054385; Mon, 22 Aug 2016 22:51:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMp7UT054384; Mon, 22 Aug 2016 22:51:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMp7UT054384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304646 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:51:09 -0000 Author: bdrewery Date: Mon Aug 22 22:51:07 2016 New Revision: 304646 URL: https://svnweb.freebsd.org/changeset/base/304646 Log: For 'make ' hook into the all_subdir_ 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 will properly redirect to the all_subdir_ target rather than invoking the inline shell. This also makes 'make -jX ' now respect any SUBDIR_DEPEND_ 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?