Makefile: add $(DEVELOPER_CFLAGS) variable
This does not change the behavior, but allows the user to tweak DEVELOPER_CFLAGS on the command-line or in a config.mak* file if needed. This also makes the code somewhat cleaner as it follows the pattern <initialisation of variables> <include statements> <actual build logic> by specifying which flags to activate in the first part, and actually activating them in the last one. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Jun 1, 2016 at 10:00 UTC
51dd3e81d4b5098d7eca9a1370616b8e8f7784c2
1 file changed
+10
-9
Makefile
+10
-9
@@ -375,6 +375,15 @@ GIT-VERSION-FILE: FORCE
375
# CFLAGS and LDFLAGS are for the users to override from the command line.
376
377
CFLAGS = -g -O2 -Wall
378
+DEVELOPER_CFLAGS = -Werror \
379
+ -Wdeclaration-after-statement \
380
+ -Wno-format-zero-length \
381
+ -Wold-style-definition \
382
+ -Woverflow \
383
+ -Wpointer-arith \
384
+ -Wstrict-prototypes \
385
+ -Wunused \
386
+ -Wvla
387
LDFLAGS =
388
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
389
ALL_LDFLAGS = $(LDFLAGS)
@@ -941,15 +950,7 @@ include config.mak.uname
950
-include config.mak
951
952
ifdef DEVELOPER
944
-CFLAGS += -Werror \
945
- -Wdeclaration-after-statement \
946
- -Wno-format-zero-length \
947
- -Wold-style-definition \
948
- -Woverflow \
949
- -Wpointer-arith \
950
- -Wstrict-prototypes \
951
- -Wunused \
952
- -Wvla
953
+CFLAGS += $(DEVELOPER_CFLAGS)
954
endif
955
956
ifndef sysconfdir