Skip to content

Commit c610296

Browse files
committed
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.
1 parent caae282 commit c610296

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,14 @@ include mk/artifact.mk
311311
include mk/system.mk
312312
include mk/wasm.mk
313313

314-
all: config $(BUILD_DTB) $(BUILD_DTB2C) $(BIN)
314+
DTB_DEPS :=
315+
ifeq ($(call has, SYSTEM), 1)
316+
ifeq ($(call has, ELF_LOADER), 0)
317+
DTB_DEPS := $(BUILD_DTB) $(BUILD_DTB2C)
318+
endif
319+
endif
320+
321+
all: config $(DTB_DEPS) $(BIN)
315322

316323
OBJS := \
317324
map.o \

0 commit comments

Comments
 (0)