Move ~/.tigrc documentation into it's own man page, tigrc(5)
[tig] / Makefile
CommitLineData
4c6fabc2 1PREFIX = $(HOME)
c9a2f784 2LDLIBS = -lcurses
900666fc 3CFLAGS = -Wall -O2
19f862bd 4DFLAGS = -g -DDEBUG -Werror
b801d8b2 5PROGS = tig
cb7f42cd 6DOCS = tig.1.txt tig.1.html tig.1 tigrc.5.html tigrc.5 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 ;; \
cb7f42cd 28 *.5) install $$doc $(PREFIX)/man/man5 ;; \
4c6fabc2 29 esac \
a7bc4b14 30 done
05f1685b
JF
31
32clean:
8855ada4 33 rm -f $(PROGS) $(DOCS) core
05f1685b 34
57bdf034
JF
35spell-check:
36 aspell --lang=en --check tig.1.txt
37
b801d8b2 38.PHONY: all docs install clean
a7bc4b14 39
b801d8b2
JF
40tig: tig.c
41
42tig.1.txt: tig.c
b76c2afc 43 sed -n '/\/\*\*/,/\*\*\//p' < $< | \
660e09ad 44 sed 's/.*\*\*\/.*//' | \
b76c2afc 45 sed '/^[^*]*\*\*/d' | \
b801d8b2 46 sed 's/\*\///;s/^[^*]*\* *//' > $@
a7bc4b14 47
b8ae9346
JF
48README.html: README
49 asciidoc -b xhtml11 -d article -f web.conf $<
50
a7bc4b14 51%.1.html : %.1.txt
4c6fabc2 52 asciidoc -b xhtml11 -d manpage $<
a7bc4b14
JF
53
54%.1.xml : %.1.txt
4c6fabc2 55 asciidoc -b docbook -d manpage $<
a7bc4b14
JF
56
57%.1 : %.1.xml
58 xmlto man $<
cb7f42cd
JF
59
60%.5.html : %.5.txt
61 asciidoc -b xhtml11 -d manpage $<
62
63%.5.xml : %.5.txt
64 asciidoc -b docbook -d manpage $<
65
66%.5 : %.5.xml
67 xmlto man $<