Skip to content

Commit 9a8fe19

Browse files
committed
Fixed regressions with non-existing uart-drivers
in build tests
1 parent 37a1df7 commit 9a8fe19

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

options.mk

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,18 @@ ifeq ($(NO_XIP),1)
618618
endif
619619

620620
ifeq ($(DEBUG_UART),1)
621-
CFLAGS+=-DDEBUG_UART
622-
UART_DRV_OBJ:=hal/uart/uart_drv_$(UART_TARGET).o
623-
ifneq ($(findstring $(UART_DRV_OBJ),$(OBJS)),$(UART_DRV_OBJ))
624-
OBJS+=$(UART_DRV_OBJ)
621+
ifeq ($(strip $(UART_TARGET)),)
622+
$(warning DEBUG_UART=1 but UART_TARGET is not set; DEBUG_UART disabled)
623+
else
624+
UART_DRV_OBJ:=hal/uart/uart_drv_$(UART_TARGET).o
625+
ifneq ($(wildcard $(UART_DRV_OBJ)),)
626+
CFLAGS+=-DDEBUG_UART
627+
ifneq ($(findstring $(UART_DRV_OBJ),$(OBJS)),$(UART_DRV_OBJ))
628+
OBJS+=$(UART_DRV_OBJ)
629+
endif
630+
else
631+
$(warning DEBUG_UART=1 but $(UART_DRV_OBJ) not found; DEBUG_UART disabled)
632+
endif
625633
endif
626634
endif
627635
ifeq ($(NO_QNX),1)

0 commit comments

Comments
 (0)