Commit | Line | Data |
---|---|---|
4c6fabc2 | 1 | PREFIX = $(HOME) |
c9a2f784 | 2 | LDLIBS = -lcurses |
e2beda18 | 3 | CFLAGS = -Wall |
19f862bd | 4 | DFLAGS = -g -DDEBUG -Werror |
b801d8b2 | 5 | PROGS = tig |
b8ae9346 | 6 | DOCS = tig.1.txt tig.1.html tig.1 README.html |
e2beda18 JF |
7 | |
8 | ifneq (,$(wildcard .git)) | |
9074d9b6 JF |
9 | VERSION = $(shell git-describe) |
10 | WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null) | |
11 | CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"' | |
e2beda18 | 12 | endif |
800a900c | 13 | |
a7bc4b14 | 14 | all: $(PROGS) |
82e78006 JF |
15 | all-debug: $(PROGS) |
16 | all-debug: CFLAGS += $(DFLAGS) | |
a7bc4b14 | 17 | docs: $(DOCS) |
800a900c | 18 | |
05f1685b | 19 | install: all |
a7bc4b14 | 20 | for prog in $(PROGS); do \ |
4c6fabc2 JF |
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 | esac \ | |
a7bc4b14 | 29 | done |
05f1685b JF |
30 | |
31 | clean: | |
8855ada4 | 32 | rm -f $(PROGS) $(DOCS) core |
05f1685b | 33 | |
57bdf034 JF |
34 | spell-check: |
35 | aspell --lang=en --check tig.1.txt | |
36 | ||
b801d8b2 | 37 | .PHONY: all docs install clean |
a7bc4b14 | 38 | |
b801d8b2 JF |
39 | tig: tig.c |
40 | ||
41 | tig.1.txt: tig.c | |
b76c2afc JF |
42 | sed -n '/\/\*\*/,/\*\*\//p' < $< | \ |
43 | sed 's/.*\*\*\///' | \ | |
44 | sed '/^[^*]*\*\*/d' | \ | |
b801d8b2 | 45 | sed 's/\*\///;s/^[^*]*\* *//' > $@ |
a7bc4b14 | 46 | |
b8ae9346 JF |
47 | README.html: README |
48 | asciidoc -b xhtml11 -d article -f web.conf $< | |
49 | ||
a7bc4b14 | 50 | %.1.html : %.1.txt |
4c6fabc2 | 51 | asciidoc -b xhtml11 -d manpage $< |
a7bc4b14 JF |
52 | |
53 | %.1.xml : %.1.txt | |
4c6fabc2 | 54 | asciidoc -b docbook -d manpage $< |
a7bc4b14 JF |
55 | |
56 | %.1 : %.1.xml | |
57 | xmlto man $< |