summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-09-01 00:39:02 +0000
committerjb <jb@FreeBSD.org>1998-09-01 00:39:02 +0000
commitf038ce5877c579f9724ba83bb8f86cc3e22ad294 (patch)
tree53d402c08a806ff47a485d7c4a27f11c5fc78cdf /Makefile.inc1
parent91db9d3931d6b78d14e3003b1e5288271cc453ef (diff)
downloadFreeBSD-src-f038ce5877c579f9724ba83bb8f86cc3e22ad294.zip
FreeBSD-src-f038ce5877c579f9724ba83bb8f86cc3e22ad294.tar.gz
Add a target to check the consistency of the make OBJFORMAT variable
with the object format determined by objformat. This prevents foot shooting (a form of boot scooting for hackers?) where local changes to /etc/make.conf or /etc/make.conf.local try to override OBJFORMAT in an incomplete way.
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc127
1 files changed, 25 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 86ab5c0..cd1763a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.inc1,v 1.1 1998/08/31 01:08:08 jb Exp $
+# $Id: Makefile.inc1,v 1.2 1998/08/31 20:43:13 jb Exp $
#
# Make command line options:
# -DCLOBBER will remove /usr/include
@@ -222,7 +222,7 @@ IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/make
# Attempt to rebuild the entire system, with reasonable chance of
# success, regardless of how old your existing system is.
#
-buildworld:
+buildworld: check-objformat
.if !defined(NOCLEAN)
@echo
@echo "--------------------------------------------------------------"
@@ -941,6 +941,29 @@ legacy-install:
.endif
+# Get the object format that the tools see.
+#
+#
+.if exists(/usr/bin/objformat)
+__OBJFORMAT!= objformat
+.else
+__OBJFORMAT= ${OBJFORMAT}
+.endif
+
+#
+# Check if the local /etc/make.conf or /etc/make.conf.local have attempted
+# to override the OBJFORMAT without updating the environment for the tools
+# to see.
+#
+check-objformat :
+.if ${__OBJFORMAT} != ${OBJFORMAT}
+ @/bin/sh -c "echo \"It looks like you set OBJFORMAT=${OBJFORMAT} in /etc/make.conf. Don't do that!\" "
+ @/bin/sh -c "echo \"If you want to override the installed object format, you must set OBJFORMAT\" "
+ @/bin/sh -c "echo \"in your environment.\" "
+ @exit 1
+.endif
+
+
.for __target in clean cleandepend cleandir depend obj
.for entry in ${SUBDIR}
${entry}.${__target}__D: .PHONY
OpenPOWER on IntegriCloud