aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-08-17 17:09:24 -0300
committerEuAndreh <eu@euandre.org>2021-08-17 17:09:27 -0300
commit024a359a747515eda2f3fb6e6eb1e7b8fe29b1c1 (patch)
tree645f85487f3aafcb4ad0bd6f5267149630b78f99
parentMakefile: Fix $(MANPREFIX) path (diff)
downloadgistatic-024a359a747515eda2f3fb6e6eb1e7b8fe29b1c1.tar.gz
gistatic-024a359a747515eda2f3fb6e6eb1e7b8fe29b1c1.tar.xz
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.
-rw-r--r--Makefile10
1 files 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