mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] sandbox: cut down on if clauses using SANDBOX_LIBS-y
@ 2025-10-21  6:47 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-10-21  6:47 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

This makes the Makefile a bit more readable.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/sandbox/Makefile | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 55b8ca1780df..0318c8dd1452 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -51,33 +51,26 @@ PHONY += maketools
 
 export SANDBOX_LIBS BAREBOX_LDFLAGS
 
-ifeq ($(CONFIG_SDL),y)
-SANDBOX_LIBS += $(shell $(CROSS_PKG_CONFIG) sdl2 --libs)
-endif
-
-ifeq ($(CONFIG_GPIO_LIBFTDI1),y)
-SANDBOX_LIBS += $(shell $(CROSS_PKG_CONFIG) libftdi1 --libs)
-endif
+SANDBOX_LIBS-$(CONFIG_SDL) += $(shell $(CROSS_PKG_CONFIG) sdl2 --libs)
+SANDBOX_LIBS-$(CONFIG_GPIO_LIBFTDI1) += $(shell $(CROSS_PKG_CONFIG) libftdi1 --libs)
 
 ifeq ($(CONFIG_ASAN),y)
 KBUILD_CPPFLAGS += -fsanitize=address
-SANDBOX_LIBS += -fsanitize=address
+SANDBOX_LIBS-y += -fsanitize=address
 ifeq ($(CONFIG_CC_IS_CLANG),y)
 KBUILD_CPPFLAGS += -fno-sanitize-address-globals-dead-stripping
-SANDBOX_LIBS += -fno-sanitize-address-globals-dead-stripping
+SANDBOX_LIBS-y += -fno-sanitize-address-globals-dead-stripping
 endif
 endif
 
-ifeq ($(CONFIG_UBSAN),y)
-SANDBOX_LIBS += -fsanitize=undefined
-endif
+SANDBOX_LIBS-$(CONFIG_UBSAN) += -fsanitize=undefined
 
 ifeq ($(CONFIG_FUZZ_EXTERNAL),y)
 LIBARCH-y = $(UNAME_M)
 LIBARCH-$(CONFIG_SANDBOX_LINUX_I386) = i386
 
 KBUILD_CPPFLAGS += -fsanitize=fuzzer-no-link
-SANDBOX_LIBS += -Wl,-Bstatic -L"$(CONFIG_CLANG_RUNTIME_DIR)" \
+SANDBOX_LIBS-y += -Wl,-Bstatic -L"$(CONFIG_CLANG_RUNTIME_DIR)" \
 		-lclang_rt.fuzzer_no_main-$(LIBARCH-y) -Wl,-Bdynamic
 endif
 
@@ -95,6 +88,8 @@ KBUILD_AFLAGS += -m32
 BAREBOX_LDFLAGS += -m32
 endif
 
+SANDBOX_LIBS += $(SANDBOX_LIBS-y)
+
 common-y += $(BOARD) arch/sandbox/os/ arch/sandbox/lib/
 
 SANDBOX_PROPER2PBL_GLUE_SYMS := \
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-21  6:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21  6:47 [PATCH] sandbox: cut down on if clauses using SANDBOX_LIBS-y Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox