aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-08-12 17:07:27 +0000
committerWarner Losh <imp@FreeBSD.org>2017-08-12 17:07:27 +0000
commit7709b2ae166c10e8f61b27983777d3ccb9067232 (patch)
tree2ac8cffc4d8273deaf034096ec0a8db775bbb4a3 /Makefile
parentb9c0f39213846e31e2d78c7d136a71c4605f5314 (diff)
downloadsrc-7709b2ae166c10e8f61b27983777d3ccb9067232.tar.gz
src-7709b2ae166c10e8f61b27983777d3ccb9067232.zip
Make _TO_CPUARCH macro for ARCH to CPUARCH conversions
Consolidate all the regular expressions to convert from MACHINE_ARCH to MACHINE_CPUARCH into a variable and use that variable in preference to the almost identical copies in the tree (which should have been identical). Differential Revision: https://reviews.freebsd.org/D11986
Notes
Notes: svn path=/head/; revision=322429
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f51f16a4563d..985b5025e4b0 100644
--- a/Makefile
+++ b/Makefile
@@ -245,12 +245,17 @@ _MAKE+= MK_META_MODE=no
.endif # !exists(/dev/filemon) && !defined(NO_FILEMON)
.endif # !defined(_CAN_USE_META_MODE)
-# Guess machine architecture from machine type, and vice versa.
+# Guess target architecture from target type, and vice versa, based on
+# historic FreeBSD practice of tending to have TARGET == TARGET_ARCH
+# expanding to TARGET == TARGET_CPUARCH in recent times, with known
+# exceptions.
.if !defined(TARGET_ARCH) && defined(TARGET)
+# T->TA mapping is usually TARGET with arm64 the odd man out
_TARGET_ARCH= ${TARGET:S/arm64/aarch64/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH}
-_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64(sf)?/riscv/}
+# TA->T mapping is accidentally CPUARCH with aarch64 the odd man out
+_TARGET= ${TARGET_ARCH:${__TO_CPUARCH}:C/aarch64/arm64/}
.endif
.if defined(TARGET) && !defined(_TARGET)
_TARGET=${TARGET}