summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2016-06-01 08:00:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-01 15:17:15 (GMT)
commit51dd3e81d4b5098d7eca9a1370616b8e8f7784c2 (patch)
tree2c97678646bcb62511a89a8df042663c3ead21aa
parentd615628c354ad2aaf3f3f37b3f84ddcc7c3537c6 (diff)
downloadgit-51dd3e81d4b5098d7eca9a1370616b8e8f7784c2.zip
git-51dd3e81d4b5098d7eca9a1370616b8e8f7784c2.tar.gz
git-51dd3e81d4b5098d7eca9a1370616b8e8f7784c2.tar.bz2
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>
-rw-r--r--Makefile19
1 files changed, 10 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index a8383b9..feee885 100644
--- a/Makefile
+++ b/Makefile
@@ -375,6 +375,15 @@ GIT-VERSION-FILE: FORCE
# CFLAGS and LDFLAGS are for the users to override from the command line.
CFLAGS = -g -O2 -Wall
+DEVELOPER_CFLAGS = -Werror \
+ -Wdeclaration-after-statement \
+ -Wno-format-zero-length \
+ -Wold-style-definition \
+ -Woverflow \
+ -Wpointer-arith \
+ -Wstrict-prototypes \
+ -Wunused \
+ -Wvla
LDFLAGS =
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
@@ -941,15 +950,7 @@ include config.mak.uname
-include config.mak
ifdef DEVELOPER
-CFLAGS += -Werror \
- -Wdeclaration-after-statement \
- -Wno-format-zero-length \
- -Wold-style-definition \
- -Woverflow \
- -Wpointer-arith \
- -Wstrict-prototypes \
- -Wunused \
- -Wvla
+CFLAGS += $(DEVELOPER_CFLAGS)
endif
ifndef sysconfdir