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