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

[PATCH] Makefile: do not compile git with debugging symbols by default

From
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Jan 22, 2015, 12:50 UTC
Message-ID
<1421931037-21368-1-git-send-email-kuleshovmail@gmail.com>

Standard user has no need in debugging information. This patch adds DEBUG=1 option to compile git with debugging symbols and compile without it by default.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b5b4cee..83ff691 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,8 @@ all::
 
 # Define V=1 to have a more verbose compile.
 #
+# Define DEBUG=1 to compile git with debugging symbols.
+#
 # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
 #
 # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
@@ -363,8 +365,13 @@ GIT-VERSION-FILE: FORCE
 -include GIT-VERSION-FILE
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
+DEBUG_CFLAGS=
+
+ifdef DEBUG
+	DEBUG_CFLAGS = -g
+endif
 
-CFLAGS = -g -O2 -Wall
+CFLAGS = $(DEBUG_CFLAGS) -O2 -Wall
 LDFLAGS =
 ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
-- 
2.3.0.rc1
Next: Jeff King
Message 1 of 9 in “Makefile: do not compile git with debugging symbols by default”
  1. Makefile: do not compile git with debugging symbols by defaultAlexander Kuleshov, Jan 22, 2015
  2. Jeff KingJan 22, 2015
  3. Mike HommeyJan 22, 2015
  4. Alexander KuleshovJan 22, 2015
  5. Alexander KuleshovJan 22, 2015
  6. Matthieu MoyJan 22, 2015
  7. Jeff KingJan 22, 2015
  8. Mike HommeyJan 22, 2015
  9. David AguilarJan 27, 2015

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.