From owner-svn-src-all@freebsd.org Wed Oct 7 00:24: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 B5E1D9D0B99; Wed, 7 Oct 2015 00:24:29 +0000 (UTC) (envelope-from sjg@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 74D40F61; Wed, 7 Oct 2015 00:24:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t970OS92095987; Wed, 7 Oct 2015 00:24:28 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t970OScD095982; Wed, 7 Oct 2015 00:24:28 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201510070024.t970OScD095982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 7 Oct 2015 00:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288964 - 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: Wed, 07 Oct 2015 00:24:29 -0000 Author: sjg Date: Wed Oct 7 00:24:27 2015 New Revision: 288964 URL: https://svnweb.freebsd.org/changeset/base/288964 Log: In jobs mode we can use .ORDER to force stage_links to run after other stage_* targets. In non-jobs mode we can achieve the same result by simply introducing the targets in the correct order. Thus in bsd*.mk we simply add targets to STAGE_TARGETS which we realize in meta.stage.mk Reviewed by: bdrewery Modified: head/share/mk/bsd.incs.mk head/share/mk/bsd.man.mk head/share/mk/bsd.nls.mk head/share/mk/bsd.sys.mk head/share/mk/meta.stage.mk Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Tue Oct 6 23:42:58 2015 (r288963) +++ head/share/mk/bsd.incs.mk Wed Oct 7 00:24:27 2015 (r288964) @@ -91,9 +91,9 @@ realinstall: installincludes .if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) .if !defined(NO_STAGE_INCLUDES) -staging: stage_includes +STAGE_TARGETS+= stage_includes .if !empty(INCSLINKS) -staging: stage_symlinks +STAGE_TARGETS+= stage_symlinks STAGE_SYMLINKS.INCS= ${INCSLINKS} .endif .endif Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Tue Oct 6 23:42:58 2015 (r288963) +++ head/share/mk/bsd.man.mk Wed Oct 7 00:24:27 2015 (r288964) @@ -128,7 +128,7 @@ ZEXT= ${MCOMPRESS_EXT} .if defined(MAN) && !empty(MAN) .if ${MK_STAGING_MAN} == "yes" -staging: stage_files +STAGE_TARGETS+= stage_files _mansets:= ${MAN:E:O:u:M*[1-9]:@s@man$s@} STAGE_SETS+= ${_mansets} .for _page in ${MAN} @@ -137,7 +137,7 @@ STAGE_DIR.man${_page:T:E}?= ${STAGE_OBJT .endfor .if !empty(MLINKS) STAGE_SETS+= mlinks -staging: stage_links +STAGE_TARGETS+= stage_links STAGE_LINKS.mlinks:= ${MLINKS:@f@${f:S,^,${MANDIR}${f:E}${MANSUBDIR}/,}@} stage_links.mlinks: ${_mansets:@s@stage_files.$s@} .endif Modified: head/share/mk/bsd.nls.mk ============================================================================== --- head/share/mk/bsd.nls.mk Tue Oct 6 23:42:58 2015 (r288963) +++ head/share/mk/bsd.nls.mk Wed Oct 7 00:24:27 2015 (r288964) @@ -63,7 +63,7 @@ NLSDIR?= ${SHAREDIR}/nls # .if ${MK_STAGING_PROG} == "yes" .if !defined(_SKIP_BUILD) -staging: stage_symlinks +STAGE_TARGETS+= stage_symlinks .endif STAGE_SYMLINKS.NLS= ${NLSSYMLINKS} STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Oct 6 23:42:58 2015 (r288963) +++ head/share/mk/bsd.sys.mk Wed Oct 7 00:24:27 2015 (r288964) @@ -205,7 +205,7 @@ stage_as.prog: ${PROG} .else STAGE_SETS+= prog stage_files.prog: ${PROG} -staging: stage_files +STAGE_TARGETS+= stage_files .endif .endif .endif @@ -251,18 +251,18 @@ beforebuild: stage_includes .for t in stage_libs stage_files stage_as .if target($t) -staging: $t +STAGE_TARGETS+= $t .endif .endfor .if !empty(STAGE_AS_SETS) -staging: stage_as +STAGE_TARGETS+= stage_as .endif .if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" .if !empty(LINKS) -staging: stage_links +STAGE_TARGETS+= stage_links .if ${MAKE_VERSION} < 20131001 stage_links.links: ${_LIBS} ${PROG} .endif @@ -271,7 +271,7 @@ STAGE_LINKS.links= ${LINKS} .endif .if !empty(SYMLINKS) -staging: stage_symlinks +STAGE_TARGETS+= stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} .endif Modified: head/share/mk/meta.stage.mk ============================================================================== --- head/share/mk/meta.stage.mk Tue Oct 6 23:42:58 2015 (r288963) +++ head/share/mk/meta.stage.mk Wed Oct 7 00:24:27 2015 (r288964) @@ -24,6 +24,8 @@ _dirdep = ${RELDIR}.${MACHINE} _dirdep = ${RELDIR} .endif +CLEANFILES+= .dirdep + # this allows us to trace dependencies back to their src dir .dirdep: @echo '${_dirdep}' > $@ @@ -134,7 +136,7 @@ _STAGE_AS_BASENAME_USE: .USE ${.T .if !empty(STAGE_INCSDIR) STAGE_TARGETS += stage_incs -STAGE_INCS ?= ${.ALLSRC:N.dirdep} +STAGE_INCS ?= ${.ALLSRC:N.dirdep:Nstage_*} stage_includes: stage_incs stage_incs: .dirdep @@ -145,7 +147,7 @@ stage_incs: .dirdep .if !empty(STAGE_LIBDIR) STAGE_TARGETS += stage_libs -STAGE_LIBS ?= ${.ALLSRC:N.dirdep} +STAGE_LIBS ?= ${.ALLSRC:N.dirdep:Nstage_*} stage_libs: .dirdep @${STAGE_FILE_SCRIPT}; StageFiles ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${STAGE_LIBS} @@ -177,8 +179,8 @@ CLEANFILES += ${STAGE_SETS:@s@stage*$s@} # some makefiles need to populate multiple directories .for s in ${STAGE_SETS:O:u} -STAGE_FILES.$s ?= ${.ALLSRC:N.dirdep} -STAGE_SYMLINKS.$s ?= ${.ALLSRC:N.dirdep} +STAGE_FILES.$s ?= ${.ALLSRC:N.dirdep:Nstage_*} +STAGE_SYMLINKS.$s ?= ${.ALLSRC:N.dirdep:Nstage_*} STAGE_LINKS_DIR.$s ?= ${STAGE_OBJTOP} STAGE_SYMLINKS_DIR.$s ?= ${STAGE_OBJTOP} @@ -224,7 +226,7 @@ STAGE_TARGETS += stage_as # each ${file} will be staged as ${STAGE_AS_${file:T}} # one could achieve the same with SYMLINKS .for s in ${STAGE_AS_SETS:O:u} -STAGE_AS.$s ?= ${.ALLSRC:N.dirdep} +STAGE_AS.$s ?= ${.ALLSRC:N.dirdep:Nstage_*} stage_as: stage_as.$s stage_as.$s: .dirdep @@ -237,15 +239,16 @@ stage_as.$s: .dirdep CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes # stage_*links usually needs to follow any others. -.if !empty(STAGE_SETS) && !empty(STAGE_TARGETS:Nstage_links) -.for s in ${STAGE_SETS:O:u} -stage_links.$s: ${STAGE_TARGETS:Nstage_links:O:u} +# for non-jobs mode the order here matters +staging: ${STAGE_TARGETS:N*_links} ${STAGE_TARGETS:M*_links} + +.if ${.MAKE.JOBS:U0} > 0 && ${STAGE_TARGETS:M*_links} != "" +# the above isn't sufficient +.for t in ${STAGE_TARGETS:N*links:O:u} +.ORDER: $t stage_links .endfor .endif -# make sure this exists -staging: - # generally we want staging to wait until everything else is done STAGING_WAIT ?= .WAIT