mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
Makefile: move 'ifdef DEVELOPER' after config.mak* inclusion
The DEVELOPER knob was introduced in 658df95
(add DEVELOPER makefile
knob to check for acknowledged warnings, 2016-02-25), and works well
when used as "make DEVELOPER=1", and when the configure script was not
used.
However, the advice given in CodingGuidelines to add DEVELOPER=1 to
config.mak does not: config.mak is included after testing for
DEVELOPER in the Makefile, and at least GNU Make's manual specifies
"Conditional directives are parsed immediately", hence the config.mak
declaration is not visible at the time the conditional is evaluated.
Also, when using the configure script to generate a
config.mak.autogen, the later file contained a "CFLAGS = <flags>"
initialization, which overrode the "CFLAGS += -W..." triggered by
DEVELOPER.
This patch fixes both issues.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b051c59a00
commit
d615628c35
1 changed files with 12 additions and 12 deletions
24
Makefile
24
Makefile
|
@ -380,18 +380,6 @@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
|
|||
ALL_LDFLAGS = $(LDFLAGS)
|
||||
STRIP ?= strip
|
||||
|
||||
ifdef DEVELOPER
|
||||
CFLAGS += -Werror \
|
||||
-Wdeclaration-after-statement \
|
||||
-Wno-format-zero-length \
|
||||
-Wold-style-definition \
|
||||
-Woverflow \
|
||||
-Wpointer-arith \
|
||||
-Wstrict-prototypes \
|
||||
-Wunused \
|
||||
-Wvla
|
||||
endif
|
||||
|
||||
# Create as necessary, replace existing, make ranlib unneeded.
|
||||
ARFLAGS = rcs
|
||||
|
||||
|
@ -952,6 +940,18 @@ include config.mak.uname
|
|||
-include config.mak.autogen
|
||||
-include config.mak
|
||||
|
||||
ifdef DEVELOPER
|
||||
CFLAGS += -Werror \
|
||||
-Wdeclaration-after-statement \
|
||||
-Wno-format-zero-length \
|
||||
-Wold-style-definition \
|
||||
-Woverflow \
|
||||
-Wpointer-arith \
|
||||
-Wstrict-prototypes \
|
||||
-Wunused \
|
||||
-Wvla
|
||||
endif
|
||||
|
||||
ifndef sysconfdir
|
||||
ifeq ($(prefix),/usr)
|
||||
sysconfdir = /etc
|
||||
|
|
Loading…
Reference in a new issue