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