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