summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/Makefile16
-rw-r--r--share/mk/local.sys.mk6
2 files changed, 12 insertions, 10 deletions
diff --git a/include/Makefile b/include/Makefile
index 8033de1..80900ef 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -131,6 +131,7 @@ _MARCHS+= x86
.if ${MK_STAGING} == "yes"
# tell bsd.incs.mk that we have it covered
NO_STAGE_INCLUDES=
+META_COOKIES+= stage_prep stage_include compat copies symlinks
.endif
.include <bsd.prog.mk>
@@ -157,6 +158,7 @@ ${SHARED}: compat
# Take care of stale directory-level symlinks.
compat:
+ ${META_COOKIE_RM}
.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
@@ -165,11 +167,10 @@ compat:
mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
-f ${.CURDIR}/../etc/mtree/BSD.include.dist \
-p ${DESTDIR}${INCLUDEDIR} > /dev/null
-.if ${MK_DIRDEPS_BUILD} == "yes"
- @touch ${.TARGET}
-.endif
+ ${META_COOKIE_TOUCH}
copies:
+ ${META_COOKIE_RM}
.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
${_MARCHS}
if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
@@ -254,11 +255,10 @@ copies:
cd ${.CURDIR}/../sys/teken; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
${DESTDIR}${INCLUDEDIR}/teken
-.if ${MK_DIRDEPS_BUILD} == "yes"
- @touch ${.OBJDIR}/${.TARGET}
-.endif
+ ${META_COOKIE_TOUCH}
symlinks:
+ ${META_COOKIE_RM}
@${ECHO} "Setting up symlinks to kernel source tree..."
.for i in ${LDIRS}
cd ${.CURDIR}/../sys/$i; \
@@ -371,9 +371,7 @@ symlinks:
${INSTALL_SYMLINK} ../../../sys/rpc/$$h \
${DESTDIR}${INCLUDEDIR}/rpc; \
done
-.if ${MK_DIRDEPS_BUILD} == "yes"
- @touch ${.OBJDIR}/${.TARGET}
-.endif
+ ${META_COOKIE_TOUCH}
.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
# we're here because we are building a sysroot...
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index c1baee5..269e253 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -28,10 +28,14 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
.if ${.MAKE.MODE:Mmeta*} != ""
# we can afford to use cookies to prevent some targets
# re-running needlessly
-META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
+META_COOKIE= ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
+META_COOKIE_RM= @rm -f ${META_COOKIE}
+META_COOKIE_TOUCH= @touch ${META_COOKIE}
# some targets need to be .PHONY - but not in meta mode
META_NOPHONY=
+CLEANFILES+= ${META_COOKIES}
.else
+META_COOKIE_RM=
META_COOKIE_TOUCH=
META_NOPHONY= .PHONY
.endif
OpenPOWER on IntegriCloud