提交 51dd3e81 编写于 作者: M Matthieu Moy 提交者: Junio C Hamano

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: NMatthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d615628c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册