From bb15724dd416a042e1539505fab2f6cc84f8dd6a Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Sun, 11 May 2025 00:59:25 +0800 Subject: [PATCH] Refine the build system The top-level 'Makefile' unconditionally includes mk/{arm,riscv}.mk, and the shell substitutions inside those two files run immediately even when the active architecture is Arm. That is why the "no qemu-riscv32 found" message appears during an Arm build. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 63b9b985..5e5c12f1 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,6 @@ CFLAGS := -O -g \ BUILD_SESSION := .session.mk include mk/common.mk -include mk/arm.mk -include mk/riscv.mk -include $(BUILD_SESSION) STAGE0 := shecc @@ -43,6 +41,7 @@ all: config bootstrap ifeq (,$(filter $(ARCH),$(ARCHS))) $(error Support ARM and RISC-V only. Select the target with "ARCH=arm" or "ARCH=riscv") endif +include mk/$(ARCH).mk ifneq ("$(wildcard $(PWD)/config)","") TARGET_EXEC := $($(shell head -1 config | sed 's/.*: \([^ ]*\).*/\1/')_EXEC)