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