mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
makefiles/arch/riscv.inc.mk: speed up toolchain detection
- Use a sane (a.k.a. simply expanded) variable for the `$(TARGET_ARCH)` instead of an insane (a.k.a. recursive expended) variable - The toolchain detection will now happen only once, rather than each and every time `$(TARGET_ARCH)` is referenced - Use a single call to `which` rather than one per possible target triple Fixes https://github.com/RIOT-OS/RIOT/issues/19788
This commit is contained in:
parent
c2df430deb
commit
55e223353a
@ -35,10 +35,15 @@ TARGET_ARCH_RISCV ?= \
|
|||||||
$(subst -gcc,,\
|
$(subst -gcc,,\
|
||||||
$(notdir \
|
$(notdir \
|
||||||
$(word 1,\
|
$(word 1,\
|
||||||
$(foreach triple,$(_TRIPLES_TO_TEST),$(shell which $(triple)-gcc 2> /dev/null))))))
|
$(shell which $(addsuffix -gcc,$(_TRIPLES_TO_TEST)) 2> /dev/null)))))
|
||||||
|
|
||||||
TARGET_ARCH ?= $(TARGET_ARCH_RISCV)
|
TARGET_ARCH ?= $(TARGET_ARCH_RISCV)
|
||||||
|
|
||||||
|
# Convert to a simply expanded variable here, as a recursively expended
|
||||||
|
# variable would result in detecting the toolchain each and every time again the
|
||||||
|
# toolchain is referenced.
|
||||||
|
TARGET_ARCH := $(TARGET_ARCH)
|
||||||
|
|
||||||
ifeq (,$(TARGET_ARCH))
|
ifeq (,$(TARGET_ARCH))
|
||||||
$(error No RISC-V toolchain detected. Make sure a RISC-V toolchain is installed.)
|
$(error No RISC-V toolchain detected. Make sure a RISC-V toolchain is installed.)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user