genericize target exclusion for missing external toolchain

Previously we excluded riscv from make universe / tinderbox if the
required xtoolchain package was not installed. Make that logic generic
so that we can loop over multiple architectures, in preparation to test
patches to have other architectures rely on external toolchain.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11652
This commit is contained in:
Ed Maste 2017-07-27 12:29:31 +00:00
parent 9a3083660d
commit 6d2909f6a0

View File

@ -441,14 +441,22 @@ TARGET_ARCHES_${target}?= ${target}
MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc
# XXX Remove riscv from universe if the required toolchain package is missing. # XXX Remove architectures only supported by external toolchain from universe
.if !exists(/usr/local/share/toolchains/riscv64-gcc.mk) && ${TARGETS:Mriscv} # if required toolchain packages are missing.
_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Nriscv} TOOLCHAINS_riscv= riscv64
universe: universe_riscv_skip .PHONY .for target in riscv
universe_epilogue: universe_riscv_skip .PHONY .if ${_UNIVERSE_TARGETS:M${target}}
universe_riscv_skip: universe_prologue .PHONY .for toolchain in ${TOOLCHAINS_${target}}
@echo ">> riscv skipped - install riscv64-xtoolchain-gcc port or package to build" .if !exists(/usr/local/share/toolchains/${toolchain}-gcc.mk)
_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}}
universe: universe_${toolchain}_skip .PHONY
universe_epilogue: universe_${toolchain}_skip .PHONY
universe_${toolchain}_skip: universe_prologue .PHONY
@echo ">> ${target} skipped - install ${toolchain}-xtoolchain-gcc port or package to build"
.endif .endif
.endfor
.endif
.endfor
.if defined(UNIVERSE_TARGET) .if defined(UNIVERSE_TARGET)
MAKE_JUST_WORLDS= YES MAKE_JUST_WORLDS= YES