git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: add $(DEVELOPER_CFLAGS) variable

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jun 1, 2016, 08:00 UTC
Message-ID
<20160601080008.7348-1-Matthieu.Moy@imag.fr>
In-Reply-To
<vpqpos11gv3.fsf@anie.imag.fr>

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>
---
Junio, you can add this to mm/makefile-developer-can-be-in-config-mak
(or squash it in the commit, but having two separate commit messages
make sense IMO).
 Makefile | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 2226319..9753abe 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
-- 
2.8.2.397.gbe91ebf.dirty
Previous: Matthieu MoyNext: Jeff King
Message 5 of 7 in “Makefile: move 'ifdef DEVELOPER' after config.mak* inclusion”
  1. Makefile: move 'ifdef DEVELOPER' after config.mak* inclusionMatthieu Moy, May 31, 2016
  2. Junio C HamanoMay 31, 2016
  3. Jeff KingJun 1, 2016
  4. Matthieu MoyJun 1, 2016
  5. Makefile: add $(DEVELOPER_CFLAGS) variableMatthieu Moy, Jun 1, 2016
  6. Jeff KingJun 1, 2016
  7. Jeff KingJun 1, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.