Further improve documentation
[tig] / Makefile
CommitLineData
4c6fabc2 1PREFIX = $(HOME)
800a900c 2LDFLAGS = -lcurses
82e78006
JF
3CFLAGS = '-DVERSION="$(VERSION)"' -Wall
4DFLAGS = -g -DDEBUG
b801d8b2 5PROGS = tig
468876c9 6DOCS = tig.1.txt tig.1.html tig.1
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
b801d8b2 29.PHONY: all docs install clean
a7bc4b14 30
b801d8b2
JF
31tig: tig.c
32
33tig.1.txt: tig.c
b76c2afc
JF
34 sed -n '/\/\*\*/,/\*\*\//p' < $< | \
35 sed 's/.*\*\*\///' | \
36 sed '/^[^*]*\*\*/d' | \
b801d8b2 37 sed 's/\*\///;s/^[^*]*\* *//' > $@
a7bc4b14
JF
38
39%.1.html : %.1.txt
4c6fabc2 40 asciidoc -b xhtml11 -d manpage $<
a7bc4b14
JF
41
42%.1.xml : %.1.txt
4c6fabc2 43 asciidoc -b docbook -d manpage $<
a7bc4b14
JF
44
45%.1 : %.1.xml
46 xmlto man $<