summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-04-14 21:04:45 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-04-14 21:04:45 +0000
commita8b775f4b792dc1d1c33d5b736997099e2d62501 (patch)
tree931d9dc1538c6eb8c3fe4f8cf0114de4c1f31038 /share/mk
parentc41790fef1cb2ed2cad05aa6c9ff83de183593e3 (diff)
downloadFreeBSD-src-a8b775f4b792dc1d1c33d5b736997099e2d62501.zip
FreeBSD-src-a8b775f4b792dc1d1c33d5b736997099e2d62501.tar.gz
Follow-up r297835: Let the intented default cookie work.
This happened to work for not prepending .OBJDIR twice but broke the other case of prepending it when needed. Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/local.sys.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index 68e679f..e3d212c 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -37,8 +37,11 @@ OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP}
# should be added as a target dependency as well. Otherwise the target
# is added to in bsd.sys.mk since it comes last.
.if ${.MAKE.MODE:Mnofilemon} == ""
-META_COOKIE_COND= empty(.TARGET:M${.OBJDIR})
-META_COOKIE= ${COOKIE.${.TARGET}:U${${META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}}}
+# Prepend .OBJDIR if not already there.
+_META_COOKIE_COND= "${.TARGET:M${.OBJDIR}/*}" == ""
+_META_COOKIE_DEFAULT= ${${_META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}}
+# Use the default if COOKIE.${.TARGET} is not defined.
+META_COOKIE= ${COOKIE.${.TARGET}:U${_META_COOKIE_DEFAULT}}
META_COOKIE_RM= @rm -f ${META_COOKIE}
META_COOKIE_TOUCH= @touch ${META_COOKIE}
CLEANFILES+= ${META_TARGETS}
OpenPOWER on IntegriCloud