aboutsummaryrefslogtreecommitdiff
path: root/share/mk/local.sys.mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/local.sys.mk')
-rw-r--r--share/mk/local.sys.mk12
1 files changed, 7 insertions, 5 deletions
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index 2236dfe2f460..59d689933a67 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -27,12 +27,11 @@ 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
+# re-running needlessly but only when using filemon.
+.if ${.MAKE.MODE:Mnofilemon} == ""
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_TARGETS}
_meta_dep_before: .USEBEFORE
${META_COOKIE_RM}
@@ -42,9 +41,12 @@ _meta_dep_after: .USE
# not rerunning a command if it doesn't need to be considering its
# metafile/filemon-tracked dependencies.
META_DEPS= _meta_dep_before _meta_dep_after .META
+.endif
.else
-META_COOKIE_RM=
-META_COOKIE_TOUCH=
+# some targets need to be .PHONY - but not in meta mode
META_NOPHONY= .PHONY
.endif
+META_NOPHONY?=
+META_COOKIE_RM?=
+META_COOKIE_TOUCH?=
META_DEPS+= ${META_NOPHONY}