Cache all queries for refs based on ID
[tig] / Makefile
CommitLineData
4c6fabc2 1PREFIX = $(HOME)
c9a2f784 2LDLIBS = -lcurses
e2beda18 3CFLAGS = -Wall
19f862bd 4DFLAGS = -g -DDEBUG -Werror
b801d8b2 5PROGS = tig
b8ae9346 6DOCS = tig.1.txt tig.1.html tig.1 README.html
e2beda18
JF
7
8ifneq (,$(wildcard .git))
9074d9b6
JF
9VERSION = $(shell git-describe)
10WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
11CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
e2beda18 12endif
800a900c 13
a7bc4b14 14all: $(PROGS)
82e78006
JF
15all-debug: $(PROGS)
16all-debug: CFLAGS += $(DFLAGS)
a7bc4b14 17docs: $(DOCS)
800a900c 18
05f1685b 19install: all
a7bc4b14 20 for prog in $(PROGS); do \
4c6fabc2
JF
21 install $$prog $(PREFIX)/bin; \
22 done
23
24install-docs: docs
25 for doc in $(DOCS); do \
26 case "$$doc" in \
27 *.1) install $$doc $(PREFIX)/man/man1 ;; \
28 esac \
a7bc4b14 29 done
05f1685b
JF
30
31clean:
8855ada4 32 rm -f $(PROGS) $(DOCS) core
05f1685b 33
57bdf034
JF
34spell-check:
35 aspell --lang=en --check tig.1.txt
36
b801d8b2 37.PHONY: all docs install clean
a7bc4b14 38
b801d8b2
JF
39tig: tig.c
40
41tig.1.txt: tig.c
b76c2afc
JF
42 sed -n '/\/\*\*/,/\*\*\//p' < $< | \
43 sed 's/.*\*\*\///' | \
44 sed '/^[^*]*\*\*/d' | \
b801d8b2 45 sed 's/\*\///;s/^[^*]*\* *//' > $@
a7bc4b14 46
b8ae9346
JF
47README.html: README
48 asciidoc -b xhtml11 -d article -f web.conf $<
49
a7bc4b14 50%.1.html : %.1.txt
4c6fabc2 51 asciidoc -b xhtml11 -d manpage $<
a7bc4b14
JF
52
53%.1.xml : %.1.txt
4c6fabc2 54 asciidoc -b docbook -d manpage $<
a7bc4b14
JF
55
56%.1 : %.1.xml
57 xmlto man $<