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