Move stuff to BUGS and TODO files; only show BUGS in tig(1)
[tig] / Makefile
1 PREFIX  = $(HOME)
2 LDLIBS  = -lcurses
3 CFLAGS  = -Wall -O2
4 DFLAGS  = -g -DDEBUG -Werror
5 PROGS   = tig
6 DOCS    = tig.1.txt tig.1.html tig.1 tigrc.5.html tigrc.5 README.html
7
8 ifneq (,$(wildcard .git))
9 VERSION = $(shell git-describe)
10 WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
11 CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
12 endif
13
14 all: $(PROGS)
15 all-debug: $(PROGS)
16 all-debug: CFLAGS += $(DFLAGS)
17 docs: $(DOCS)
18
19 install: all
20         for prog in $(PROGS); do \
21                 install $$prog $(PREFIX)/bin; \
22         done
23
24 install-docs: docs
25         for doc in $(DOCS); do \
26                 case "$$doc" in \
27                 *.1) install $$doc $(PREFIX)/man/man1 ;; \
28                 *.5) install $$doc $(PREFIX)/man/man5 ;; \
29                 esac \
30         done
31
32 clean:
33         rm -f $(PROGS) $(DOCS) core
34
35 spell-check:
36         aspell --lang=en --check tig.1.txt
37
38 .PHONY: all docs install clean
39
40 tig: tig.c
41
42 tig.1.txt: tig.c
43         sed -n '/\/\*\*/,/\*\*\//p' < $< | \
44         sed 's/.*\*\*\/.*//' | \
45         sed '/^[^*]*\*\*/d' | \
46         sed 's/\*\///;s/^[^*]*\* *//' > $@
47
48 README.html: README
49         asciidoc -b xhtml11 -d article -f web.conf $<
50
51 %.1.html : %.1.txt
52         asciidoc -b xhtml11 -d manpage $<
53
54 %.1.xml : %.1.txt
55         asciidoc -b docbook -d manpage $<
56
57 %.1 : %.1.xml
58         xmlto man $<
59
60 %.5.html : %.5.txt
61         asciidoc -b xhtml11 -d manpage $<
62
63 %.5.xml : %.5.txt
64         asciidoc -b docbook -d manpage $<
65
66 %.5 : %.5.xml
67         xmlto man $<