Code

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