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

[PATCH] Allow CFLAGS to be overridden while preserving VERSION

From
James Bowes <jbowes@dangerouslyinc.com>
Date
Jun 2, 2007, 17:14 UTC
Message-ID
<118080449045-git-send-email-jbowes@dangerouslyinc.com>

If someone defined their own CFLAGS, they would have to include a -DVERSION= as well (or else get unknown-version as the version).

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 61fc86b..91cb097 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ endif
 RPM_VERSION = $(subst -,.,$(VERSION))
 
 LDLIBS	= -lcurses
-CFLAGS	= -Wall -O2 '-DVERSION="$(VERSION)"'
+CFLAGS	= -Wall -O2
 DFLAGS	= -g -DDEBUG -Werror
 PROGS	= tig
 MANDOC	= tig.1 tigrc.5
@@ -28,6 +28,8 @@ HTMLDOC = tig.1.html tigrc.5.html manual.html README.html
 ALLDOC	= $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf
 TARNAME	= tig-$(RPM_VERSION)
 
+override CFLAGS += '-DVERSION="$(VERSION)"'
+
 all: $(PROGS)
 all-debug: $(PROGS)
 all-debug: CFLAGS += $(DFLAGS)
-- 
1.5.2.888.g96a5e
Next: Jonas Fonseca
Message 1 of 2 in “Allow CFLAGS to be overridden while preserving VERSION”
  1. Allow CFLAGS to be overridden while preserving VERSIONJames Bowes, Jun 2, 2007
  2. Jonas FonsecaJun 2, 2007

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.