From 8706983ff67016e2af122973c49cda9eb0576e77 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 28 Jun 2018 22:24:16 +0000 Subject: [PATCH] Fix unknown target check after r335450. X-MFC-with: r335450 Pointyhat to: bdrewery Sponsored by: Dell EMC --- Makefile.inc1 | 69 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 88da712d8db9..7ec6d2317d98 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -129,6 +129,40 @@ MACHINE_ABI?= unknown MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 +KNOWN_ARCHES?= aarch64/arm64 \ + amd64 \ + arm \ + armeb/arm \ + armv6/arm \ + armv7/arm \ + i386 \ + mips \ + mipsel/mips \ + mips64el/mips \ + mipsn32el/mips \ + mips64/mips \ + mipsn32/mips \ + mipshf/mips \ + mipselhf/mips \ + mips64elhf/mips \ + mips64hf/mips \ + powerpc \ + powerpc64/powerpc \ + powerpcspe/powerpc \ + riscv64/riscv \ + riscv64sf/riscv \ + sparc64 + +.if ${TARGET} == ${TARGET_ARCH} +_t= ${TARGET} +.else +_t= ${TARGET_ARCH}/${TARGET} +.endif +.for _t in ${_t} +.if empty(KNOWN_ARCHES:M${_t}) +.error Unknown target ${TARGET_ARCH}:${TARGET}. +.endif +.endfor # If all targets are disabled for system llvm then don't expect it to work # for cross-builds. @@ -525,41 +559,6 @@ PKG_VERSION= ${_REVISION}${EXTRA_REVISION} .endif .endif # !defined(_MKSHOWCONFIG) -KNOWN_ARCHES?= aarch64/arm64 \ - amd64 \ - arm \ - armeb/arm \ - armv6/arm \ - armv7/arm \ - i386 \ - mips \ - mipsel/mips \ - mips64el/mips \ - mipsn32el/mips \ - mips64/mips \ - mipsn32/mips \ - mipshf/mips \ - mipselhf/mips \ - mips64elhf/mips \ - mips64hf/mips \ - powerpc \ - powerpc64/powerpc \ - powerpcspe/powerpc \ - riscv64/riscv \ - riscv64sf/riscv \ - sparc64 - -.if ${TARGET} == ${TARGET_ARCH} -_t= ${TARGET} -.else -_t= ${TARGET_ARCH}/${TARGET} -.endif -.for _t in ${_t} -.if empty(KNOWN_ARCHES:M${_t}) -.error Unknown target ${TARGET_ARCH}:${TARGET}. -.endif -.endfor - .if !defined(_MKSHOWCONFIG) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE