From 5f7647dc0cdb8cbdacdb5e817ebb3131a58faba0 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 21 Apr 2025 15:09:19 -0500 Subject: [PATCH] make: Forward all LFS_* prefixed environment variables as defines So instead of: CFLAGS='-DLFS_YES_REVDBG=1' make You can just do: LFS_YES_REVDBG=1 make I've been hesitant to add this, as I've never seen this pattern in another project (why?), but it's just too convenient to not give it a try. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 5f8f2a85..fdf64a69 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,9 @@ ifdef PERFBDGEN CFLAGS += -fno-omit-frame-pointer endif +# also forward all LFS_* environment variables +CFLAGS += $(foreach D,$(filter LFS_%,$(.VARIABLES)),-D$D=$($D)) + TEST_CFLAGS += -Wno-unused-function TEST_CFLAGS += -Wno-format-overflow