From dc368d812a1d307a439e0a5823d4695d16c98c45 Mon Sep 17 00:00:00 2001 From: sjg Date: Sat, 30 May 2015 15:08:52 +0000 Subject: [PATCH] Define SRCTOP in src.sys.mk Because src.sys.mk should only ever be found in the src tree we can use its position (.PARSEDIR) to set SRCTOP. Reviewed by: bapt, imp --- share/mk/src.sys.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk index 78a0c2378671..580481071eed 100644 --- a/share/mk/src.sys.mk +++ b/share/mk/src.sys.mk @@ -5,13 +5,16 @@ # 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_) -.include "${SRCCONF}" +.sinclude "${SRCCONF}" _srcconf_included_: .NOTMAIN .endif -# If we were found via .../share/mk we need to replace that in +# If we were found via .../share/mk we need to replace that # with ${.PARSEDIR:tA} so that we can be found by # sub-makes launched from objdir. .if ${.MAKEFLAGS:M.../share/mk} != ""