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