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