summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-09-07 07:37:16 +0000
committerimp <imp@FreeBSD.org>2006-09-07 07:37:16 +0000
commit2828f34d490fb3c8f25a43103b63dd7b3a611ffc (patch)
treecc2b56c73798feaa90567130ef427f7de7bac57f /Makefile.inc1
parent82698a46fbe3e558954cca2bf17ea78a374337b3 (diff)
downloadFreeBSD-src-2828f34d490fb3c8f25a43103b63dd7b3a611ffc.zip
FreeBSD-src-2828f34d490fb3c8f25a43103b63dd7b3a611ffc.tar.gz
make "make TARGET=foo" work correctly. Before, it would fail to set
TARGET_ARCH correctly. Now it does, even for pc98. We should suggest TARGET=foo in preference to TARGET_ARCH because the former is unambiguous and the latter isn't, so update the docs. This means that a long standing gripe I've had with this comes to a close. I can build pc98 w/o specify both things. make TARGET=arm works (rather than trying to build a arm:amd64 image and dying badly in the attempt). If you specify only TARGET_ARCH, then you get the old behavior. # we can likely simplify the UNIVERSE target now to use this, but I'm not # up for breaking that tonight :-). # We should consider adding some kind of sanity check for TARGET_ARCH # and TARGET.
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc15
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 3a6ad84..84d2f9d 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -11,7 +11,7 @@
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
-# TARGET_ARCH="arch" to crossbuild world to a different arch
+# TARGET="arch" to crossbuild world to a different arch
#
# The intended user-driven targets are:
@@ -95,6 +95,9 @@ OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
OSRELDATE= 0
.endif
.endif
+.if defined(TARGET) && !defined(TARGET_ARCH)
+TARGET_ARCH=${TARGET:S/pc98/i386/}
+.endif
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == ${MACHINE_ARCH}
TARGET?= ${MACHINE}
OpenPOWER on IntegriCloud