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)
* 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: