From owner-svn-src-all@freebsd.org Mon Aug 22 22:51:02 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 A401ABC2A76; Mon, 22 Aug 2016 22:51:02 +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 69D5D1C22; Mon, 22 Aug 2016 22:51:02 +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 u7MMp1Rc054292; Mon, 22 Aug 2016 22:51:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMp1Z5054291; Mon, 22 Aug 2016 22:51:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMp1Z5054291@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:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304644 - 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:02 -0000 Author: bdrewery Date: Mon Aug 22 22:51:01 2016 New Revision: 304644 URL: https://svnweb.freebsd.org/changeset/base/304644 Log: Stop using _SUBDIR internally for non-SUBDIR_PARALLEL builds. This is unifying more of the logic. Rather than create targets such as 'all: all_subdir_foo' when using SUBDIR_PARALLEL and using 'all: _SUBDIR' when not using SUBDIR_PARALLEL, always use the expanded out _subdir_ pattern. When not using SUBDIR_PARALLEL, have each directory-target depend on the previously defined targets as to respect the *order* of SUBDIR. Using 'make -N' now prints all directory traversals individually rather than using a loop, since a loop is no longer used to traverse. This is part of an effort to cleanup handling of some edge cases involving 'make ' and making it simpler in the sense that the pattern used to build is the same for all modes. 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:50:58 2016 (r304643) +++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:01 2016 (r304644) @@ -114,6 +114,8 @@ _SUBDIR_SH= \ cd ${.CURDIR}/$${dir}; \ ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ +# This is kept for compatibility only. The normal handling of attaching to +# SUBDIR_TARGETS will create a target for each directory. _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}target=${.TARGET:realinstall=install}; \ @@ -139,29 +141,31 @@ 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 ${__dir} == .WAIT __subdir_targets+= .WAIT .else -__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} __deps= .if ${_is_standalone_target} == 0 +.if defined(SUBDIR_PARALLEL) +# Apply SUBDIR_DEPEND dependencies for SUBDIR_PARALLEL. .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${DIRPRFX}${__dep} .endfor -.endif +.else +# For non-parallel builds, directories depend on all targets before them. +__deps:= ${__subdir_targets} +.endif # defined(SUBDIR_PARALLEL) +.endif # ${_is_standalone_target} == 0 ${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE .SILENT ${__deps} @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ ${_SUBDIR_SH}; -.endif +__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} +.endif # ${__dir} == .WAIT .endfor # __dir in ${SUBDIR} ${__target}: ${__subdir_targets} .PHONY -.else -${__target}: _SUBDIR .PHONY -.endif # SUBDIR_PARALLEL || _is_standalone_target .endif # make(${__target}) .endfor # __target in ${SUBDIR_TARGETS}