From f63a27e48932b496524024966e6e641ca244a3eb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 5 Jan 2022 08:16:43 -0800 Subject: build: support CPPFLAGS. * Makefile (TXR_CFLAGS): Pull in $(CPPFLAGS) also. It seems some distros like Gentoo are relying on programs to interpolate CPPFLAGS, and use this variable for passing preprocessor-level options like -Dfoo=bar. This is an incredibly bad, unnecessary idea, but let's play along. Now because we are merging this into TXR_CFLAGS, it means that these preprocessor-only flags are used for linking, when nothing is being preprocessed, which makes no sense. However, GNU Make's built-in recipe for linking C code seems to do the same thing. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d0354aa5..b5e446e4 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ endif VERBOSE := TXR_CFLAGS := -iquote . $(if $(top_srcdir), -iquote $(top_srcdir)) \ - $(LANG_FLAGS) $(DIAG_FLAGS) \ - $(DBG_FLAGS) $(PLATFORM_CFLAGS) $(EXTRA_FLAGS) $(CFLAGS) + $(LANG_FLAGS) $(DIAG_FLAGS) $(DBG_FLAGS) $(PLATFORM_CFLAGS) \ + $(EXTRA_FLAGS) $(CFLAGS) $(CPPFLAGS) TXR_CFLAGS := $(filter-out $(REMOVE_FLAGS),$(TXR_CFLAGS)) TXR_LDFLAGS := $(CONF_LDFLAGS) $(PLATFORM_LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) TXR_LDLIBS := -lm $(CONF_LDLIBS) $(PLAFORM_LDLIBS) $(EXTRA_LDLIBS) $(LDLIBS) -- cgit v1.2.3