From 024a359a747515eda2f3fb6e6eb1e7b8fe29b1c1 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 17 Aug 2021 17:09:24 -0300 Subject: Makefile: Use CFLAGS_FINAL and LDLIBS_FINAL This allows the caller to not only provide $(CFLAGS), but also override $(FINAL_CFLAGS). This accomplishes a similar behaviour to "CFLAGS += ...", but now allowing the caller to discard the appended flags too. --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8b2d4e1..3659ce0 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ NAME = gistatic MAILING_LIST = public-inbox TRANSLATIONS = pt fr eo CONTRIBLANGS = -LOCALLDLIBS = -lgit2 -DEFS = \ +LDLIBS_FINAL = $(LDLIBS) -lgit2 +CFLAGS_FINAL = $(CFLAGS) \ -D_POSIX_C_SOURCE=200809L \ -DVERSION='"$(VERSION)"' \ -DDATE='"$(DATE)"' @@ -19,12 +19,10 @@ DEFS = \ sed -e 's:@VERSION@:$(VERSION):g' -e 's:@DATE@:$(DATE):g' < $< > $@ .c: - $(CC) $(CFLAGS) $(DEFS) $(LDFLAGS) -o $@ $< $(LOCALLDLIBS) \ - $(LDLIBS) + $(CC) $(CFLAGS_FINAL) $(LDFLAGS) -o $@ $< $(LDLIBS_FINAL) .c.t: - $(CC) $(CFLAGS) $(DEFS) $(LDFLAGS) -DTEST -o $@ $< $(LOCALLDLIBS) \ - $(LDLIBS) + $(CC) $(CFLAGS_FINAL) $(LDFLAGS) -DTEST -o $@ $< $(LDLIBS_FINAL) manpages.en.in = \ doc/gistatic.en.1.in -- cgit v1.2.3