Improve documentation
[tig] / Makefile
CommitLineData
4c6fabc2 1PREFIX = $(HOME)
800a900c 2LDFLAGS = -lcurses
82e78006
JF
3CFLAGS = '-DVERSION="$(VERSION)"' -Wall
4DFLAGS = -g -DDEBUG
b801d8b2
JF
5PROGS = tig
6DOCS = tig.1.txt tig.1 tig.1.html
7VERSION = $(shell git-describe)
800a900c 8
a7bc4b14 9all: $(PROGS)
82e78006
JF
10all-debug: $(PROGS)
11all-debug: CFLAGS += $(DFLAGS)
a7bc4b14 12docs: $(DOCS)
800a900c 13
05f1685b 14install: all
a7bc4b14 15 for prog in $(PROGS); do \
4c6fabc2
JF
16 install $$prog $(PREFIX)/bin; \
17 done
18
6b161b31 19
4c6fabc2
JF
20install-docs: docs
21 for doc in $(DOCS); do \
22 case "$$doc" in \
23 *.1) install $$doc $(PREFIX)/man/man1 ;; \
24 esac \
a7bc4b14 25 done
05f1685b
JF
26
27clean:
a7bc4b14 28 rm -f $(PROGS) $(DOCS)
05f1685b 29
b801d8b2 30.PHONY: all docs install clean
a7bc4b14 31
b801d8b2
JF
32tig: tig.c
33
34tig.1.txt: tig.c
b76c2afc
JF
35 sed -n '/\/\*\*/,/\*\*\//p' < $< | \
36 sed 's/.*\*\*\///' | \
37 sed '/^[^*]*\*\*/d' | \
b801d8b2 38 sed 's/\*\///;s/^[^*]*\* *//' > $@
a7bc4b14
JF
39
40%.1.html : %.1.txt
4c6fabc2 41 asciidoc -b xhtml11 -d manpage $<
a7bc4b14
JF
42
43%.1.xml : %.1.txt
4c6fabc2 44 asciidoc -b docbook -d manpage $<
a7bc4b14
JF
45
46%.1 : %.1.xml
47 xmlto man $<