From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] sandbox: cut down on if clauses using SANDBOX_LIBS-y
Date: Tue, 21 Oct 2025 08:47:55 +0200 [thread overview]
Message-ID: <20251021064756.775098-1-a.fatoum@barebox.org> (raw)
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
reply other threads:[~2025-10-21 6:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251021064756.775098-1-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox