summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2004-08-11 11:02:26 +0000
committerru <ru@FreeBSD.org>2004-08-11 11:02:26 +0000
commit504141f1b2ecdfdc542315992bb564e7843636c0 (patch)
treef0b000aa142f4310c4726ca7583d664dc3ce558b /Makefile.inc1
parent3d16b5d93ef49c2b40148fdb108a3c861f6a46ff (diff)
downloadFreeBSD-src-504141f1b2ecdfdc542315992bb564e7843636c0.zip
FreeBSD-src-504141f1b2ecdfdc542315992bb564e7843636c0.tar.gz
Enforce the check that MAKEOBJDIRPREFIX (if set) is set in environment
only, and not as a global (in /etc/make.conf) or command-line variable. MAKEOBJDIRPREFIX has never been a global or command-line variable, and the fact that it works in some scenarios for "make buildworld" doesn't make it any more correct. Using it as a global or command-line variable is error prone, discouraged, costs us lot of false build reports, etc. This commit is aimed to fix it once and for all. Anyone potentially objecting to this change is encouraged to read the make(1) and make.conf(5) manpages, and the comments regarding the use of the MAKEOBJDIRPREFIX variable in /usr/share/mk/bsd.obj.mk and /usr/share/examples/etc/make.conf.
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc17
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 5105dd6..ac0a491 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -93,6 +93,13 @@ SUPFLAGS+= -h ${SUPHOST}
.endif
MAKEOBJDIRPREFIX?= /usr/obj
+_MAKEOBJDIRPREFIX!= env -i PATH=${PATH} MAKEFLAGS="${.MAKEFLAGS}" ${MAKE} \
+ -f /dev/null -V MAKEOBJDIRPREFIX dummy
+.if !empty(_MAKEOBJDIRPREFIX)
+.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
+ (in /etc/make.conf) or command-line variable.
+.endif
+
.if !defined(OSRELDATE)
.if exists(/usr/include/osreldate.h)
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
OpenPOWER on IntegriCloud