4 docdir = $(prefix)/share/doc
9 DFLAGS = -g -DDEBUG -Werror
11 DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
12 manual.toc manual.html manual.html-chunked manual.pdf \
15 ifneq (,$(wildcard .git))
16 VERSION = $(shell git-describe)
17 WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
18 CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
23 all-debug: CFLAGS += $(DFLAGS)
27 mkdir -p $(DESTDIR)$(bindir) && \
28 for prog in $(PROGS); do \
29 install $$prog $(DESTDIR)$(bindir); \
33 mkdir -p $(DESTDIR)$(mandir)/man1 \
34 $(DESTDIR)$(mandir)/man5 \
35 $(DESTDIR)$(docdir)/tig
36 for doc in $(DOCS); do \
38 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
39 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
40 *.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
45 rm -rf manual.html-chunked
46 rm -f $(PROGS) $(DOCS) core *.xml
49 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
54 .PHONY: all all-debug doc install install-doc clean spell-check
56 manual.toc: manual.txt
57 sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
59 "-----"*) echo ". <<$$ref>>"; ref= ;; \
60 "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
61 "[["*"]]") ref="$$line" ;; \
62 *) ref="$$ref, $$line" ;; \
63 esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
68 asciidoc -b xhtml11 -d article -a readme $<
74 asciidoc -b xhtml11 -d manpage $<
77 asciidoc -b docbook -d manpage $<
83 asciidoc -b xhtml11 -d manpage $<
86 asciidoc -b docbook -d manpage $<
92 asciidoc -b xhtml11 -d article -n $<
95 asciidoc -b docbook -d article $<
97 %.html-chunked : %.xml
104 cg commit -m "Merge with master"
106 cg commit -m "Sync docs"