diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 8c09fc76e7fb..7560e7ffc5b7 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -59,11 +59,19 @@ all: ${PROGS} # We cannot capture dependencies for meta mode here UPDATE_DEPENDFILE = NO + +.if ${MK_STAGING} != "no" +.if !empty(PROGS) +stage_files.prog: ${PROGS} +.endif +.endif # ${MK_STAGING} != "no" .endif .endif # PROGS || PROGS_CXX # These are handled by the main make process. .ifdef _RECURSING_PROGS +MK_STAGING= no + _PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS CONFGROUPS FILESGROUPS INCSGROUPS \ SCRIPTS .for v in ${_PROGS_GLOBAL_VARS} diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk index 79018a4311a9..104b980d7274 100644 --- a/share/mk/bsd.test.mk +++ b/share/mk/bsd.test.mk @@ -93,30 +93,4 @@ beforecheck realcheck aftercheck check: .PHONY .ORDER: beforecheck realcheck aftercheck check: beforecheck realcheck aftercheck -.ifdef PROG -# we came here via bsd.progs.mk below -# parent will do staging. -MK_STAGING= no -.endif - -.if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) .include -.endif -.include - -.if !defined(PROG) && ${MK_STAGING} != "no" -.if !defined(_SKIP_BUILD) -# this will handle staging if needed -_SKIP_STAGING= no -# but we don't want it to build anything -_SKIP_BUILD= -.endif -.if !empty(PROGS) -stage_files.prog: ${PROGS} -.endif -.include -.endif - -.if !target(objwarn) -.include -.endif