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 for prog in $(PROGS); do \
28 install $$prog $(DESTDIR)$(bindir); \
32 mkdir -p $(DESTDIR)$(mandir)/man1 \
33 $(DESTDIR)$(mandir)/man5 \
34 $(DESTDIR)$(docdir)/tig
35 for doc in $(DOCS); do \
37 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
38 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
39 *.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
44 rm -rf manual.html-chunked
45 rm -f $(PROGS) $(DOCS) core *.xml
48 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
53 .PHONY: all all-debug doc install install-doc clean spell-check
55 manual.toc: manual.txt
56 sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
58 "-----"*) echo ". <<$$ref>>"; ref= ;; \
59 "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
60 "[["*"]]") ref="$$line" ;; \
61 *) ref="$$ref, $$line" ;; \
62 esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
67 asciidoc -b xhtml11 -d article -a readme $<
73 asciidoc -b xhtml11 -d manpage $<
76 asciidoc -b docbook -d manpage $<
82 asciidoc -b xhtml11 -d manpage $<
85 asciidoc -b docbook -d manpage $<
91 asciidoc -b xhtml11 -d article -n $<
94 asciidoc -b docbook -d article $<
96 %.html-chunked : %.xml
103 cg commit -m "Merge with master"
105 cg commit -m "Sync docs"