From dd8e3b8b3e2d55c586e80e62d88719909bd8a568 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 21 May 2024 15:53:52 -0400 Subject: build: Allow flags.mk to override command line variables Previously, during something like ./configure LDFLAGS=..., any additions to LDFLAGS from the generated makefiles were ignored. I had thought that sub-make invocations would allow those variables to be overridden, but that is not the behaviour of make. So instead, set _LDFLAGS etc. in the generated files so that they don't conflict. --- build/pkgs.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build/pkgs.mk') diff --git a/build/pkgs.mk b/build/pkgs.mk index 39b550d..5a26548 100644 --- a/build/pkgs.mk +++ b/build/pkgs.mk @@ -15,9 +15,9 @@ gen/pkgs.mk: ${HEADERS} @printf '# %s\n' "$@" >$@ @gen() { \ printf 'PKGS := %s\n' "$$*"; \ - printf 'CFLAGS += %s\n' "$$(build/pkgconf.sh --cflags "$$@")"; \ - printf 'LDFLAGS += %s\n' "$$(build/pkgconf.sh --ldflags "$$@")"; \ - printf 'LDLIBS := %s $${LDLIBS}\n' "$$(build/pkgconf.sh --ldlibs "$$@")"; \ + printf '_CFLAGS += %s\n' "$$(build/pkgconf.sh --cflags "$$@")"; \ + printf '_LDFLAGS += %s\n' "$$(build/pkgconf.sh --ldflags "$$@")"; \ + printf '_LDLIBS := %s $${_LDLIBS}\n' "$$(build/pkgconf.sh --ldlibs "$$@")"; \ }; \ gen $$(grep -l ' true$$' ${.ALLSRC} | sed 's|.*/\(.*\)\.h|\1|') >>$@ ${VCAT} $@ -- cgit v1.2.3