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.
This commit is contained in:
Christopher Haster
2025-04-21 15:09:19 -05:00
parent 3ccd7d39be
commit 5f7647dc0c
+3
View File
@@ -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