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