-prefix = $(HOME)
-bindir = $(prefix)/bin
-mandir = $(prefix)/man
-docdir = $(prefix)/share/doc
+## Makefile for tig
+
+# Include setting from the configure script
+-include config.make
+
+prefix ?= $(HOME)
+bindir ?= $(prefix)/bin
+mandir ?= $(prefix)/man
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc
# DESTDIR=
# Get version either via git or from VERSION file. Allow either
RPM_RELEASE = $(word 2,$(RPM_VERLIST))$(if $(WTDIRTY),.dirty)
LDLIBS = -lcurses
-CFLAGS = -Wall -O2
+CFLAGS ?= -Wall -O2
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
MANDOC = tig.1 tigrc.5
override CFLAGS += '-DVERSION="$(VERSION)"'
+AUTOHEADER ?= autoheader
+AUTOCONF ?= autoconf
+
all: $(PROGS)
all-debug: $(PROGS)
all-debug: CFLAGS += $(DFLAGS)
rpm: dist
rpmbuild -ta $(TARNAME).tar.gz
+configure: configure.ac
+ $(AUTOHEADER)
+ $(AUTOCONF)
+
# Maintainer stuff
release-doc:
git checkout release && \