From c6102969b2c971a572dd8de929901bfa8f8dc61d Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Wed, 15 Oct 2025 02:01:16 +0800 Subject: [PATCH] Fix DTB conditional build regression Only build DTB when ENABLE_SYSTEM=1 and ENABLE_ELF_LOADER=0, resolving DTC syntax errors that occur when building with ELF loader mode enabled, as CFLAGS_dt macros are only defined in kernel emulation mode. The DTB is only needed for Linux kernel emulation, not for ELF loader mode which loads bare-metal programs directly. --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e0b4abc6..e3eae877 100644 --- a/Makefile +++ b/Makefile @@ -311,7 +311,14 @@ include mk/artifact.mk include mk/system.mk include mk/wasm.mk -all: config $(BUILD_DTB) $(BUILD_DTB2C) $(BIN) +DTB_DEPS := +ifeq ($(call has, SYSTEM), 1) +ifeq ($(call has, ELF_LOADER), 0) +DTB_DEPS := $(BUILD_DTB) $(BUILD_DTB2C) +endif +endif + +all: config $(DTB_DEPS) $(BIN) OBJS := \ map.o \