From owner-svn-src-all@freebsd.org Fri Oct 23 21:30:29 2015 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 6C120A1C314; Fri, 23 Oct 2015 21:30:29 +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 25BB315ED; Fri, 23 Oct 2015 21:30:29 +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 t9NLUSlJ021954; Fri, 23 Oct 2015 21:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9NLUSVL021953; Fri, 23 Oct 2015 21:30:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510232130.t9NLUSVL021953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 23 Oct 2015 21:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289856 - 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.20 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: Fri, 23 Oct 2015 21:30:29 -0000 Author: bdrewery Date: Fri Oct 23 21:30:27 2015 New Revision: 289856 URL: https://svnweb.freebsd.org/changeset/base/289856 Log: Rework r289778 to always parallelize known targets, without ordering. - Rather than allow 'make clean*' to ignore dependencies, make a static list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe. This allows a user to override them if needed and avoids adding this feature to user-defined targets that are in ${SUBDIR_TARGETS}. [1] - This now also allows to force SUBDIR_PARALLEL when calling these targets, since no dependencies are needed. Reported by: ian [1] Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks X-MFC-With: r289778 Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Fri Oct 23 21:30:18 2015 (r289855) +++ head/share/mk/bsd.subdir.mk Fri Oct 23 21:30:27 2015 (r289856) @@ -28,6 +28,10 @@ # See ALL_SUBDIR_TARGETS for list of targets that will recurse. # Custom targets can be added to SUBDIR_TARGETS in src.conf. # +# Targets defined in STANDALONE_SUBDIR_TARGETS will always be ran +# with SUBDIR_PARALLEL and will not respect .WAIT or SUBDIR_DEPEND_ +# values. +# .if !target(____) ____: @@ -38,6 +42,10 @@ ALL_SUBDIR_TARGETS= all all-man buildcon realinstall regress tags \ ${SUBDIR_TARGETS} +# Described above. +STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \ + cleanilinks cleanobj + .include .if !defined(NEED_SUBDIR) @@ -83,19 +91,17 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; -# .WAIT and dependencies can be skipped for some targets. -.if defined(SUBDIR_PARALLEL) -.if make(obj) || make(clean*) -_skip_subdir_ordering= 1 -SUBDIR:= ${SUBDIR:N.WAIT} -.else -_skip_subdir_ordering= 0 -.endif -.endif # defined(SUBDIR_PARALLEL) # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} -.ifdef SUBDIR_PARALLEL +# Can ordering be skipped for this and SUBDIR_PARALLEL forced? +.if make(${__target}) && ${STANDALONE_SUBDIR_TARGETS:M${__target}} +_is_standalone_target= 1 +SUBDIR:= ${SUBDIR:N.WAIT} +.else +_is_standalone_target= 0 +.endif +.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} .if ${__wait} == ${__dir} @@ -103,7 +109,7 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= -.if ${_skip_subdir_ordering} == 0 +.if ${_is_standalone_target} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor @@ -115,12 +121,12 @@ ${__target}_subdir_${__dir}: .PHONY .MAK ${_SUBDIR_SH}; .endif .endif -.endfor +.endfor # __dir in ${SUBDIR} ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR -.endif -.endfor +.endif # SUBDIR_PARALLEL || _is_standalone_target +.endfor # __target in ${ALL_SUBDIR_TARGETS} # This is to support 'make includes' calling 'make buildincludes' and # 'make installincludes' in the proper order, and to support these