From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 12:52:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D10A367; Wed, 23 Apr 2014 12:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 70D4D12BD; Wed, 23 Apr 2014 12:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NCqC3W026934; Wed, 23 Apr 2014 12:52:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCqCWV026933; Wed, 23 Apr 2014 12:52:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404231252.s3NCqCWV026933@svn.freebsd.org> From: Ian Lepore Date: Wed, 23 Apr 2014 12:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264822 - 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-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:52:12 -0000 Author: ian Date: Wed Apr 23 12:52:11 2014 New Revision: 264822 URL: http://svnweb.freebsd.org/changeset/base/264822 Log: Allow .WAIT to appear in SUBDIR= lists, to provide some control over parallel build order. All subdirs before a .WAIT will be built before any subdirs after it. Reviewed by: imp@ Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Apr 23 12:46:27 2014 (r264821) +++ head/share/mk/bsd.subdir.mk Wed Apr 23 12:52:11 2014 (r264822) @@ -45,7 +45,7 @@ distribute: .MAKE _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}set -e; for entry in ${SUBDIR}; do \ + @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ edir=$${entry}.${MACHINE_ARCH}; \ @@ -60,7 +60,7 @@ _SUBDIR: .USE .MAKE done .endif -${SUBDIR}: .PHONY .MAKE +${SUBDIR:N.WAIT}: .PHONY .MAKE ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ else \ @@ -68,12 +68,18 @@ ${SUBDIR}: .PHONY .MAKE fi; \ ${MAKE} all +# Work around parsing of .if nested in .for by putting .WAIT string into a var. +__wait= .WAIT .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} .ifdef SUBDIR_PARALLEL +__subdir_targets= .for __dir in ${SUBDIR} -${__target}: ${__target}_subdir_${__dir} +.if ${__wait} == ${__dir} +__subdir_targets+= .WAIT +.else +__subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ @@ -87,7 +93,9 @@ ${__target}_subdir_${__dir}: .MAKE fi; \ ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ +.endif .endfor +${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif