Skip to content

Commit 51dd3e8

Browse files
moygitster
authored andcommitted
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>
1 parent d615628 commit 51dd3e8

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ GIT-VERSION-FILE: FORCE
375375
# CFLAGS and LDFLAGS are for the users to override from the command line.
376376

377377
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
378387
LDFLAGS =
379388
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
380389
ALL_LDFLAGS = $(LDFLAGS)
@@ -941,15 +950,7 @@ include config.mak.uname
941950
-include config.mak
942951

943952
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)
953954
endif
954955

955956
ifndef sysconfdir

0 commit comments

Comments
 (0)