Ensure that $PROG isn't make .PHONY

Also add some additional control over staging (for use by bsd.test.mk)
This commit is contained in:
sjg 2013-10-12 23:51:00 +00:00
parent ba615f358d
commit 1155ebd20e

View File

@ -143,7 +143,12 @@ PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
realinstall regress subdir-all subdir-depend subdir-install \
tags whereobj
.if defined(.PARSEDIR)
# we don't want ${PROG} to be PHONY
.PHONY: ${PHONY_NOTMAIN:N${PROG:U}}
.else
.PHONY: ${PHONY_NOTMAIN}
.endif
.NOTMAIN: ${PHONY_NOTMAIN}
.if !defined(.PARSEDIR)
@ -153,6 +158,9 @@ PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \
.if ${MK_STAGING} != "no"
.if defined(_SKIP_BUILD) || (!make(all) && !make(clean*))
_SKIP_STAGING?= yes
.endif
.if ${_SKIP_STAGING:Uno} == "yes"
staging stage_libs stage_files stage_as stage_links stage_symlinks:
.else
# allow targets like beforeinstall to be leveraged
@ -168,7 +176,7 @@ staging: beforeinstall
.if ${MK_STAGING_PROG} != "no"
STAGE_DIR.prog= ${STAGE_OBJTOP}${BINDIR}
.if !empty(PROG)
.if !empty(PROG) || !empty(PROGS)
.if defined(PROGNAME)
STAGE_AS_SETS+= prog
STAGE_AS_${PROG}= ${PROGNAME}
@ -183,6 +191,9 @@ staging: stage_files
.if !empty(_LIBS) && !defined(INTERNALLIB)
stage_libs: ${_LIBS}
.if defined(SHLIB_NAME) && defined(DEBUG_FLAGS) && target(${SHLIB_NAME}.symbols)
stage_libs: ${SHLIB_NAME}.symbols
.endif
.endif
.if !empty(INCS) || !empty(INCSGROUPS) && target(buildincludes)
@ -203,6 +214,9 @@ staging: stage_as
.if !empty(LINKS)
staging: stage_links
.if ${MAKE_VERSION} < 20131001
stage_links.links: ${_LIBS} ${PROG}
.endif
STAGE_SETS+= links
STAGE_LINKS.links= ${LINKS}
.endif