summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb0ab19)
raw | patch | inline | side by side (parent: bb0ab19)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 08:46:20 +0000 (10:46 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 09:07:32 +0000 (11:07 +0200) |
Cleanup dynamic version acquiring via git.
Makefile | patch | blob | history | |
VERSION | [new file with mode: 0644] | patch | blob |
tig.c | patch | blob | history |
diff --git a/Makefile b/Makefile
index 5e96234d627a5edaaa02b61af80e6532afb7e24a..9f2d086324873c1f2987721951eeea1bad05f47f 100644 (file)
--- a/Makefile
+++ b/Makefile
docdir = $(prefix)/share/doc
# DESTDIR=
+# Get version either via git or from VERSION file
+ifneq (,$(wildcard .git))
+GITDESC = $(subst tig-,,$(shell git describe))
+WTDIRTY = $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)
+VERSION = $(GITDESC)$(WTDIRTY)
+else
+VERSION = $(shell test -f VERSION && cat VERSION || echo "unknown-version")
+endif
+
LDLIBS = -lcurses
-CFLAGS = -Wall -O2
+CFLAGS = -Wall -O2 '-DVERSION="$(VERSION)"'
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
DOCS_MAN = tig.1 tigrc.5
DOCS = $(DOCS_MAN) $(DOCS_HTML) \
manual.toc manual.pdf
-ifneq (,$(wildcard .git))
-GITDESC = $(subst tig-,,$(shell git describe))
-WTDIRTY = $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)
-VERSION = $(GITDESC)$(WTDIRTY)
-CFLAGS += '-DVERSION="tig-$(VERSION)"'
-endif
-
all: $(PROGS)
all-debug: $(PROGS)
all-debug: CFLAGS += $(DFLAGS)
index 888133efff25062a55c79d037053bebe1cc63142..e918fe63900d592799dec3bcd85eb2ac72909662 100644 (file)
--- a/tig.c
+++ b/tig.c
* GNU General Public License for more details.
*/
-#ifndef VERSION
-#define VERSION "tig-0.6.git"
+#ifndef VERSION
+#define VERSION "unknown-version"
#endif
#ifndef DEBUG
*/
static const char usage[] =
-VERSION " (" __DATE__ ")\n"
+"tig " VERSION " (" __DATE__ ")\n"
"\n"
"Usage: tig [options]\n"
" or: tig [options] [--] [git log options]\n"
break;
case REQ_SHOW_VERSION:
- report("%s (built %s)", VERSION, __DATE__);
+ report("tig-%s (built %s)", VERSION, __DATE__);
return TRUE;
case REQ_SCREEN_RESIZE: