]> Sergey Matveev's repositories - nnn.git/commitdiff
Honour CPPFLAGS
authorReiner Herrmann <reiner@reiner-h.de>
Fri, 19 Oct 2018 16:24:09 +0000 (18:24 +0200)
committerReiner Herrmann <reiner@reiner-h.de>
Fri, 19 Oct 2018 16:24:09 +0000 (18:24 +0200)
Preprocessor flags are passed in CPPFLAGS.
Debian uses it to pass hardening options (-D_FORTIFY_SOURCE)
to the compiler.

Makefile

index 30b76acab408f43647be4bb34d6d9af14613637c..64c6e204069140b8c9b148b480671fbac63622d9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,10 +26,10 @@ all: $(BIN) $(PLAYER)
 $(SRC): nnn.h
 
 $(BIN): $(SRC)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 debug: $(SRC)
-       $(CC) -DDEBUGMODE -g $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
+       $(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
 
 install: all
        $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin