File tree Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Expand file tree Collapse file tree 2 files changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,5 @@ $(ARCH_TEST_BUILD):
11
11
git submodule update --init $(dir $@ )
12
12
13
13
arch-test : $(BIN ) $(ARCH_TEST_BUILD )
14
- ifndef CROSS_COMPILE
15
- $(error GNU Toolchain for RISC-V is required. Please check package installation)
16
- endif
17
14
$(Q )$(MAKE ) --quiet -C $(ARCH_TEST_DIR ) clean
18
15
$(Q )$(MAKE ) --quiet -C $(ARCH_TEST_DIR )
Original file line number Diff line number Diff line change 9
9
endif
10
10
11
11
# Validate GNU Toolchain for RISC-V
12
- CROSS_COMPILE ?= riscv32-unknown-elf-
13
- RV32_CC = $(CROSS_COMPILE ) gcc
14
- RV32_CC := $(shell which $(RV32_CC ) )
15
- ifndef RV32_CC
16
- # xPack GNU RISC-V Embedded GCC
17
- CROSS_COMPILE = riscv-none-elf-
18
- RV32_CC = $(CROSS_COMPILE ) gcc
19
- RV32_CC := $(shell which $(RV32_CC ) )
20
- ifndef RV32_CC
21
- # DEPRECATED: Replaced by xpack-dev-tools/riscv-none-elf-gcc-xpack
22
- CROSS_COMPILE = riscv-none-embed-
23
- RV32_CC = $(CROSS_COMPILE ) gcc
24
- RV32_CC := $(shell which $(RV32_CC ) )
25
- ifndef RV32_CC
26
- $(warning No GNU Toolchain for RISC-V found.)
27
- CROSS_COMPILE :=
28
- endif
29
- endif
12
+ TOOLCHAIN_LIST := riscv-none-elf- \
13
+ riscv32-unknown-elf- \
14
+ riscv64-unknown-elf- \
15
+ riscv-none-embed-
16
+
17
+ # TODO: add support to clang/llvm based cross compilers
18
+ VALID_TOOLCHAIN := $(foreach toolchain,$(TOOLCHAIN_LIST ) , \
19
+ $(shell which $(toolchain ) gcc > /dev/null) \
20
+ $(if $(filter 0,$(.SHELLSTATUS ) ) ,$(toolchain ) ) )
21
+
22
+ # Get the first element in valid toolchain list
23
+ CROSS_COMPILE = $(word 1,$(VALID_TOOLCHAIN ) )
24
+ ifeq ($(CROSS_COMPILE ) ,)
25
+ $(error GNU Toolchain for RISC-V is required. Please check package installation)
30
26
endif
31
27
32
28
export CROSS_COMPILE
You can’t perform that action at this time.
0 commit comments