Commit | Line | Data |
---|---|---|
4c6fabc2 | 1 | PREFIX = $(HOME) |
c9a2f784 | 2 | LDLIBS = -lcurses |
900666fc | 3 | CFLAGS = -Wall -O2 |
19f862bd | 4 | DFLAGS = -g -DDEBUG -Werror |
b801d8b2 | 5 | PROGS = tig |
8eb62770 | 6 | DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \ |
d839253b | 7 | manual.html manual.html-chunked README.html |
e2beda18 JF |
8 | |
9 | ifneq (,$(wildcard .git)) | |
9074d9b6 JF |
10 | VERSION = $(shell git-describe) |
11 | WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null) | |
12 | CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"' | |
e2beda18 | 13 | endif |
800a900c | 14 | |
a7bc4b14 | 15 | all: $(PROGS) |
82e78006 JF |
16 | all-debug: $(PROGS) |
17 | all-debug: CFLAGS += $(DFLAGS) | |
c92615b1 | 18 | doc: $(DOCS) |
800a900c | 19 | |
05f1685b | 20 | install: all |
a7bc4b14 | 21 | for prog in $(PROGS); do \ |
4c6fabc2 JF |
22 | install $$prog $(PREFIX)/bin; \ |
23 | done | |
24 | ||
c92615b1 | 25 | install-doc: doc |
4c6fabc2 JF |
26 | for doc in $(DOCS); do \ |
27 | case "$$doc" in \ | |
28 | *.1) install $$doc $(PREFIX)/man/man1 ;; \ | |
cb7f42cd | 29 | *.5) install $$doc $(PREFIX)/man/man5 ;; \ |
4c6fabc2 | 30 | esac \ |
a7bc4b14 | 31 | done |
05f1685b JF |
32 | |
33 | clean: | |
d839253b | 34 | rm -rf manual.html-chunked |
8855ada4 | 35 | rm -f $(PROGS) $(DOCS) core |
05f1685b | 36 | |
57bdf034 | 37 | spell-check: |
8eb62770 | 38 | aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt |
57bdf034 | 39 | |
c92615b1 | 40 | .PHONY: all all-debug doc install install-doc clean spell-check |
a7bc4b14 | 41 | |
b801d8b2 JF |
42 | tig: tig.c |
43 | ||
b8ae9346 JF |
44 | README.html: README |
45 | asciidoc -b xhtml11 -d article -f web.conf $< | |
46 | ||
a7bc4b14 | 47 | %.1.html : %.1.txt |
4c6fabc2 | 48 | asciidoc -b xhtml11 -d manpage $< |
a7bc4b14 JF |
49 | |
50 | %.1.xml : %.1.txt | |
4c6fabc2 | 51 | asciidoc -b docbook -d manpage $< |
a7bc4b14 JF |
52 | |
53 | %.1 : %.1.xml | |
54 | xmlto man $< | |
cb7f42cd JF |
55 | |
56 | %.5.html : %.5.txt | |
57 | asciidoc -b xhtml11 -d manpage $< | |
58 | ||
59 | %.5.xml : %.5.txt | |
60 | asciidoc -b docbook -d manpage $< | |
61 | ||
62 | %.5 : %.5.xml | |
63 | xmlto man $< | |
d839253b JF |
64 | |
65 | %.html : %.txt | |
66 | asciidoc -b xhtml11 -d article $< | |
67 | ||
68 | %.xml : %.txt | |
69 | asciidoc -b docbook -d article $< | |
70 | ||
71 | %.html-chunked : %.xml | |
72 | xmlto html -o $@ $< |