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
This commit is contained in:
parent
56160b2e67
commit
eef72759b5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288964
@ -91,9 +91,9 @@ realinstall: installincludes
|
|||||||
|
|
||||||
.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD)
|
.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD)
|
||||||
.if !defined(NO_STAGE_INCLUDES)
|
.if !defined(NO_STAGE_INCLUDES)
|
||||||
staging: stage_includes
|
STAGE_TARGETS+= stage_includes
|
||||||
.if !empty(INCSLINKS)
|
.if !empty(INCSLINKS)
|
||||||
staging: stage_symlinks
|
STAGE_TARGETS+= stage_symlinks
|
||||||
STAGE_SYMLINKS.INCS= ${INCSLINKS}
|
STAGE_SYMLINKS.INCS= ${INCSLINKS}
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
@ -128,7 +128,7 @@ ZEXT= ${MCOMPRESS_EXT}
|
|||||||
|
|
||||||
.if defined(MAN) && !empty(MAN)
|
.if defined(MAN) && !empty(MAN)
|
||||||
.if ${MK_STAGING_MAN} == "yes"
|
.if ${MK_STAGING_MAN} == "yes"
|
||||||
staging: stage_files
|
STAGE_TARGETS+= stage_files
|
||||||
_mansets:= ${MAN:E:O:u:M*[1-9]:@s@man$s@}
|
_mansets:= ${MAN:E:O:u:M*[1-9]:@s@man$s@}
|
||||||
STAGE_SETS+= ${_mansets}
|
STAGE_SETS+= ${_mansets}
|
||||||
.for _page in ${MAN}
|
.for _page in ${MAN}
|
||||||
@ -137,7 +137,7 @@ STAGE_DIR.man${_page:T:E}?= ${STAGE_OBJTOP}${MANDIR}${_page:T:E}${MANSUBDIR}
|
|||||||
.endfor
|
.endfor
|
||||||
.if !empty(MLINKS)
|
.if !empty(MLINKS)
|
||||||
STAGE_SETS+= 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:= ${MLINKS:@f@${f:S,^,${MANDIR}${f:E}${MANSUBDIR}/,}@}
|
||||||
stage_links.mlinks: ${_mansets:@s@stage_files.$s@}
|
stage_links.mlinks: ${_mansets:@s@stage_files.$s@}
|
||||||
.endif
|
.endif
|
||||||
|
@ -63,7 +63,7 @@ NLSDIR?= ${SHAREDIR}/nls
|
|||||||
#
|
#
|
||||||
.if ${MK_STAGING_PROG} == "yes"
|
.if ${MK_STAGING_PROG} == "yes"
|
||||||
.if !defined(_SKIP_BUILD)
|
.if !defined(_SKIP_BUILD)
|
||||||
staging: stage_symlinks
|
STAGE_TARGETS+= stage_symlinks
|
||||||
.endif
|
.endif
|
||||||
STAGE_SYMLINKS.NLS= ${NLSSYMLINKS}
|
STAGE_SYMLINKS.NLS= ${NLSSYMLINKS}
|
||||||
STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP}
|
STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP}
|
||||||
|
@ -205,7 +205,7 @@ stage_as.prog: ${PROG}
|
|||||||
.else
|
.else
|
||||||
STAGE_SETS+= prog
|
STAGE_SETS+= prog
|
||||||
stage_files.prog: ${PROG}
|
stage_files.prog: ${PROG}
|
||||||
staging: stage_files
|
STAGE_TARGETS+= stage_files
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
@ -251,18 +251,18 @@ beforebuild: stage_includes
|
|||||||
|
|
||||||
.for t in stage_libs stage_files stage_as
|
.for t in stage_libs stage_files stage_as
|
||||||
.if target($t)
|
.if target($t)
|
||||||
staging: $t
|
STAGE_TARGETS+= $t
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
.if !empty(STAGE_AS_SETS)
|
.if !empty(STAGE_AS_SETS)
|
||||||
staging: stage_as
|
STAGE_TARGETS+= stage_as
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no"
|
.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no"
|
||||||
|
|
||||||
.if !empty(LINKS)
|
.if !empty(LINKS)
|
||||||
staging: stage_links
|
STAGE_TARGETS+= stage_links
|
||||||
.if ${MAKE_VERSION} < 20131001
|
.if ${MAKE_VERSION} < 20131001
|
||||||
stage_links.links: ${_LIBS} ${PROG}
|
stage_links.links: ${_LIBS} ${PROG}
|
||||||
.endif
|
.endif
|
||||||
@ -271,7 +271,7 @@ STAGE_LINKS.links= ${LINKS}
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if !empty(SYMLINKS)
|
.if !empty(SYMLINKS)
|
||||||
staging: stage_symlinks
|
STAGE_TARGETS+= stage_symlinks
|
||||||
STAGE_SETS+= links
|
STAGE_SETS+= links
|
||||||
STAGE_SYMLINKS.links= ${SYMLINKS}
|
STAGE_SYMLINKS.links= ${SYMLINKS}
|
||||||
.endif
|
.endif
|
||||||
|
@ -24,6 +24,8 @@ _dirdep = ${RELDIR}.${MACHINE}
|
|||||||
_dirdep = ${RELDIR}
|
_dirdep = ${RELDIR}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
CLEANFILES+= .dirdep
|
||||||
|
|
||||||
# this allows us to trace dependencies back to their src dir
|
# this allows us to trace dependencies back to their src dir
|
||||||
.dirdep:
|
.dirdep:
|
||||||
@echo '${_dirdep}' > $@
|
@echo '${_dirdep}' > $@
|
||||||
@ -134,7 +136,7 @@ _STAGE_AS_BASENAME_USE: .USE ${.TARGET:T}
|
|||||||
|
|
||||||
.if !empty(STAGE_INCSDIR)
|
.if !empty(STAGE_INCSDIR)
|
||||||
STAGE_TARGETS += stage_incs
|
STAGE_TARGETS += stage_incs
|
||||||
STAGE_INCS ?= ${.ALLSRC:N.dirdep}
|
STAGE_INCS ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
||||||
|
|
||||||
stage_includes: stage_incs
|
stage_includes: stage_incs
|
||||||
stage_incs: .dirdep
|
stage_incs: .dirdep
|
||||||
@ -145,7 +147,7 @@ stage_incs: .dirdep
|
|||||||
.if !empty(STAGE_LIBDIR)
|
.if !empty(STAGE_LIBDIR)
|
||||||
STAGE_TARGETS += stage_libs
|
STAGE_TARGETS += stage_libs
|
||||||
|
|
||||||
STAGE_LIBS ?= ${.ALLSRC:N.dirdep}
|
STAGE_LIBS ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
||||||
|
|
||||||
stage_libs: .dirdep
|
stage_libs: .dirdep
|
||||||
@${STAGE_FILE_SCRIPT}; StageFiles ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${STAGE_LIBS}
|
@${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
|
# some makefiles need to populate multiple directories
|
||||||
.for s in ${STAGE_SETS:O:u}
|
.for s in ${STAGE_SETS:O:u}
|
||||||
STAGE_FILES.$s ?= ${.ALLSRC:N.dirdep}
|
STAGE_FILES.$s ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
||||||
STAGE_SYMLINKS.$s ?= ${.ALLSRC:N.dirdep}
|
STAGE_SYMLINKS.$s ?= ${.ALLSRC:N.dirdep:Nstage_*}
|
||||||
STAGE_LINKS_DIR.$s ?= ${STAGE_OBJTOP}
|
STAGE_LINKS_DIR.$s ?= ${STAGE_OBJTOP}
|
||||||
STAGE_SYMLINKS_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}}
|
# each ${file} will be staged as ${STAGE_AS_${file:T}}
|
||||||
# one could achieve the same with SYMLINKS
|
# one could achieve the same with SYMLINKS
|
||||||
.for s in ${STAGE_AS_SETS:O:u}
|
.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: stage_as.$s
|
||||||
stage_as.$s: .dirdep
|
stage_as.$s: .dirdep
|
||||||
@ -237,15 +239,16 @@ stage_as.$s: .dirdep
|
|||||||
CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes
|
CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes
|
||||||
|
|
||||||
# stage_*links usually needs to follow any others.
|
# stage_*links usually needs to follow any others.
|
||||||
.if !empty(STAGE_SETS) && !empty(STAGE_TARGETS:Nstage_links)
|
# for non-jobs mode the order here matters
|
||||||
.for s in ${STAGE_SETS:O:u}
|
staging: ${STAGE_TARGETS:N*_links} ${STAGE_TARGETS:M*_links}
|
||||||
stage_links.$s: ${STAGE_TARGETS:Nstage_links:O:u}
|
|
||||||
|
.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
|
.endfor
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# make sure this exists
|
|
||||||
staging:
|
|
||||||
|
|
||||||
# generally we want staging to wait until everything else is done
|
# generally we want staging to wait until everything else is done
|
||||||
STAGING_WAIT ?= .WAIT
|
STAGING_WAIT ?= .WAIT
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user