From 504141f1b2ecdfdc542315992bb564e7843636c0 Mon Sep 17 00:00:00 2001 From: ru Date: Wed, 11 Aug 2004 11:02:26 +0000 Subject: 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. --- Makefile.inc1 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile.inc1') 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 }' \ -- cgit v1.1