8 DFLAGS = -g -DDEBUG -Werror
10 DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
11 manual.toc manual.html manual.html-chunked README.html \
13 ifneq (,$(wildcard .git))
14 VERSION = $(shell git-describe)
15 WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
16 CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
21 all-debug: CFLAGS += $(DFLAGS)
25 for prog in $(PROGS); do \
26 install $$prog $(DESTDIR)$(bindir); \
30 mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
31 for doc in $(DOCS); do \
33 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
34 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
39 rm -rf manual.html-chunked
40 rm -f $(PROGS) $(DOCS) core
43 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
48 .PHONY: all all-debug doc install install-doc clean spell-check
50 manual.toc: manual.txt
51 sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
53 "-----"*) echo ". <<$$ref>>"; ref= ;; \
54 "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
55 "[["*"]]") ref="$$line" ;; \
56 *) ref="$$ref, $$line" ;; \
57 esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
62 asciidoc -b xhtml11 -d article -a readme $<
65 asciidoc -b xhtml11 -d manpage $<
68 asciidoc -b docbook -d manpage $<
74 asciidoc -b xhtml11 -d manpage $<
77 asciidoc -b docbook -d manpage $<
83 asciidoc -b xhtml11 -d article -n $<
86 asciidoc -b docbook -d article $<
88 %.html-chunked : %.xml