summaryrefslogtreecommitdiffstats
path: root/share/mk/src.sys.mk
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-26 21:41:26 +0000
committersjg <sjg@FreeBSD.org>2015-05-26 21:41:26 +0000
commit9efb3976cc2f1c389dacfdd830f4bab11a56200f (patch)
tree1f00b35922c352ac5f7e2ac0a70be590ea64e5e4 /share/mk/src.sys.mk
parent723ea0be93c2be84eee8df49d9978651607274bd (diff)
downloadFreeBSD-src-9efb3976cc2f1c389dacfdd830f4bab11a56200f.zip
FreeBSD-src-9efb3976cc2f1c389dacfdd830f4bab11a56200f.tar.gz
Define SRCTOP in src.sys.mk
Use SRCTOP to replace .../ in MAKSYSPATH (avoid extra :tA) Use SRCTOP rather than ROOTSRCDIR in src.libnames.mk Merge from head
Diffstat (limited to 'share/mk/src.sys.mk')
-rw-r--r--share/mk/src.sys.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index 4bd22e5..e235a64 100644
--- a/share/mk/src.sys.mk
+++ b/share/mk/src.sys.mk
@@ -5,9 +5,22 @@
# to preserve historical (and useful) behavior. Changes here need to
# be reflected there so SRCCONF isn't included multiple times.
+# make sure this is defined in a consistent manner
+SRCTOP:= ${.PARSEDIR:tA:H:H}
+
# Allow user to configure things that only effect src tree builds.
SRCCONF?= /etc/src.conf
.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
.sinclude "${SRCCONF}"
_srcconf_included_: .NOTMAIN
.endif
+# If we were found via .../share/mk we need to replace that in
+# with ${SRCTOP} so that we can be found by
+# sub-makes launched from objdir.
+.if ${.MAKEFLAGS:M.../share/mk} != ""
+.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${SRCTOP}/share/mk,}
+.endif
+.if ${MAKESYSPATH:Uno:M*.../*} != ""
+MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${SRCTOP}/share/mk,}
+.export MAKESYSPATH
+.endif
OpenPOWER on IntegriCloud