Don't begin any update for the built-in help page
[tig] / Makefile
... / ...
CommitLineData
1PREFIX = $(HOME)
2LDLIBS = -lcurses
3CFLAGS = -Wall -O2
4DFLAGS = -g -DDEBUG -Werror
5PROGS = tig
6DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
7 manual.html manual.html-chunked README.html
8
9ifneq (,$(wildcard .git))
10VERSION = $(shell git-describe)
11WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
12CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
13endif
14
15all: $(PROGS)
16all-debug: $(PROGS)
17all-debug: CFLAGS += $(DFLAGS)
18doc: $(DOCS)
19
20install: all
21 for prog in $(PROGS); do \
22 install $$prog $(PREFIX)/bin; \
23 done
24
25install-doc: doc
26 for doc in $(DOCS); do \
27 case "$$doc" in \
28 *.1) install $$doc $(PREFIX)/man/man1 ;; \
29 *.5) install $$doc $(PREFIX)/man/man5 ;; \
30 esac \
31 done
32
33clean:
34 rm -rf manual.html-chunked
35 rm -f $(PROGS) $(DOCS) core
36
37spell-check:
38 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
39
40.PHONY: all all-debug doc install install-doc clean spell-check
41
42tig: tig.c
43
44README.html: README
45 asciidoc -b xhtml11 -d article -f web.conf $<
46
47%.1.html : %.1.txt
48 asciidoc -b xhtml11 -d manpage $<
49
50%.1.xml : %.1.txt
51 asciidoc -b docbook -d manpage $<
52
53%.1 : %.1.xml
54 xmlto man $<
55
56%.5.html : %.5.txt
57 asciidoc -b xhtml11 -d manpage $<
58
59%.5.xml : %.5.txt
60 asciidoc -b docbook -d manpage $<
61
62%.5 : %.5.xml
63 xmlto man $<
64
65%.html : %.txt
66 asciidoc -b xhtml11 -d article $<
67
68%.xml : %.txt
69 asciidoc -b docbook -d article $<
70
71%.html-chunked : %.xml
72 xmlto html -o $@ $<