Misc doc improvements
[tig] / Makefile
CommitLineData
5f7b975a
JH
1prefix = $(HOME)
2bindir= $(prefix)/bin
3mandir = $(prefix)/man
4# DESTDIR=
5
c9a2f784 6LDLIBS = -lcurses
900666fc 7CFLAGS = -Wall -O2
19f862bd 8DFLAGS = -g -DDEBUG -Werror
b801d8b2 9PROGS = tig
8eb62770 10DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
d839253b 11 manual.html manual.html-chunked README.html
e2beda18
JF
12
13ifneq (,$(wildcard .git))
9074d9b6
JF
14VERSION = $(shell git-describe)
15WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
16CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
e2beda18 17endif
800a900c 18
a7bc4b14 19all: $(PROGS)
82e78006
JF
20all-debug: $(PROGS)
21all-debug: CFLAGS += $(DFLAGS)
c92615b1 22doc: $(DOCS)
800a900c 23
05f1685b 24install: all
a7bc4b14 25 for prog in $(PROGS); do \
5f7b975a 26 install $$prog $(DESTDIR)$(bindir); \
4c6fabc2
JF
27 done
28
c92615b1 29install-doc: doc
5f7b975a 30 mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
4c6fabc2
JF
31 for doc in $(DOCS); do \
32 case "$$doc" in \
5f7b975a
JH
33 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
34 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
4c6fabc2 35 esac \
a7bc4b14 36 done
05f1685b
JF
37
38clean:
d839253b 39 rm -rf manual.html-chunked
8855ada4 40 rm -f $(PROGS) $(DOCS) core
05f1685b 41
57bdf034 42spell-check:
8eb62770 43 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
57bdf034 44
0e92d312
JF
45strip: all
46 strip $(PROGS)
47
c92615b1 48.PHONY: all all-debug doc install install-doc clean spell-check
a7bc4b14 49
b801d8b2
JF
50tig: tig.c
51
b8ae9346 52README.html: README
511147de 53 asciidoc -b xhtml11 -d article -a readme $<
b8ae9346 54
a7bc4b14 55%.1.html : %.1.txt
4c6fabc2 56 asciidoc -b xhtml11 -d manpage $<
a7bc4b14
JF
57
58%.1.xml : %.1.txt
4c6fabc2 59 asciidoc -b docbook -d manpage $<
a7bc4b14
JF
60
61%.1 : %.1.xml
62 xmlto man $<
cb7f42cd
JF
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 $<
d839253b
JF
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 $@ $<