threads / patch / 8399

patchAllow CFLAGS to be overridden while preserving VERSION

Subject: [PATCH] Allow CFLAGS to be overridden while preserving VERSION

## tl;dr

2 messages between Jun 2, 2007 and Jun 2, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

James Bowes· Jun 2, 2007, 17:14 UTC · lore

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(-)
Show changes to Makefile +3 −1
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
Jonas Fonseca· Jun 2, 2007, 18:35 UTC · re: James Bowes · lore

Re: [PATCH] Allow CFLAGS to be overridden while preserving VERSION

James Bowes <jbowes@dangerouslyinc.com> wrote Sat, Jun 02, 2007:
> If someone defined their own CFLAGS, they would have to include a -DVERSION=
> as well (or else get unknown-version as the version).
Thank you, applied and pushed out.
-- 
Jonas Fonseca

← back to recent threads