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