4 docdir = $(prefix)/share/doc
9 DFLAGS = -g -DDEBUG -Werror
11 DOCS_MAN = tig.1 tigrc.5
12 DOCS_HTML = tig.1.html tigrc.5.html \
13 manual.html manual.html-chunked \
15 DOCS = $(DOCS_MAN) $(DOCS_HTML) \
18 ifneq (,$(wildcard .git))
19 VERSION = $(shell git-describe)
20 WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
21 CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
26 all-debug: CFLAGS += $(DFLAGS)
29 doc-html: $(DOCS_HTML)
32 mkdir -p $(DESTDIR)$(bindir) && \
33 for prog in $(PROGS); do \
34 install $$prog $(DESTDIR)$(bindir); \
37 install-doc-man: doc-man
38 mkdir -p $(DESTDIR)$(mandir)/man1 \
39 $(DESTDIR)$(mandir)/man5
40 for doc in $(DOCS); do \
42 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
43 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
47 install-doc-html: doc-html
48 mkdir -p $(DESTDIR)$(docdir)/tig
49 for doc in $(DOCS); do \
51 *.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
55 install-doc: install-doc-man install-doc-html
58 rm -rf manual.html-chunked
59 rm -f $(PROGS) $(DOCS) core *.xml
62 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
67 .PHONY: all all-debug doc doc-man doc-html install install-doc install-doc-man install-doc-html clean spell-check
69 manual.html: manual.toc
70 manual.toc: manual.txt
71 sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
73 "-----"*) echo ". <<$$ref>>"; ref= ;; \
74 "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
75 "[["*"]]") ref="$$line" ;; \
76 *) ref="$$ref, $$line" ;; \
77 esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
82 asciidoc -b xhtml11 -d article -a readme $<
88 asciidoc -b xhtml11 -d manpage $<
91 asciidoc -b docbook -d manpage $<
94 xmlto -m manpage.xsl man $<
97 asciidoc -b xhtml11 -d manpage $<
100 asciidoc -b docbook -d manpage $<
103 xmlto -m manpage.xsl man $<
106 asciidoc -b xhtml11 -d article -n $<
109 asciidoc -b docbook -d article $<
111 %.html-chunked : %.xml
118 cg commit -m "Merge with master"
120 cg commit -m "Sync docs"