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 GITDESC
= $(subst tig-
,,$(shell git describe
))
20 WTDIRTY
= $(if
$(shell git-diff-index HEAD
2>/dev
/null
),-dirty
)
21 VERSION
= $(GITDESC
)$(WTDIRTY
)
22 CFLAGS
+= '-DVERSION="tig-$(VERSION)"'
27 all-debug
: CFLAGS
+= $(DFLAGS
)
30 doc-html
: $(DOCS_HTML
)
33 mkdir
-p
$(DESTDIR
)$(bindir) && \
34 for prog in
$(PROGS
); do \
35 install $$prog $(DESTDIR
)$(bindir); \
38 install-doc-man
: doc-man
39 mkdir
-p
$(DESTDIR
)$(mandir)/man1 \
40 $(DESTDIR
)$(mandir)/man5
41 for doc in
$(DOCS
); do \
43 *.1) install $$doc $(DESTDIR
)$(mandir)/man1
;; \
44 *.5) install $$doc $(DESTDIR
)$(mandir)/man5
;; \
48 install-doc-html
: doc-html
49 mkdir
-p
$(DESTDIR
)$(docdir
)/tig
50 for doc in
$(DOCS
); do \
52 *.html
) install $$doc $(DESTDIR
)$(docdir
)/tig
;; \
56 install-doc
: install-doc-man install-doc-html
59 rm -rf manual.html-chunked
60 rm -f
$(PROGS
) $(DOCS
) core
*.xml
63 aspell
--lang
=en
--check tig
.1.txt tigrc
.5.txt manual.txt
68 .PHONY
: all all-debug doc doc-man doc-html
install install-doc install-doc-man install-doc-html
clean spell-check
70 manual.html
: manual.toc
71 manual.toc
: manual.txt
72 sed
-n
'/^\[\[/,/\(---\|~~~\)/p' < $< | while read line
; do \
74 "-----"*) echo
". <<$$ref>>"; ref
= ;; \
75 "~~~~~"*) echo
"- <<$$ref>>"; ref
= ;; \
76 "[["*"]]") ref
="$$line" ;; \
77 *) ref
="$$ref, $$line" ;; \
78 esac
; done | sed
's/\[\[\(.*\)\]\]/\1/' > $@
83 asciidoc
-b xhtml11
-d article
-a readme
$<
89 asciidoc
-b xhtml11
-d manpage
$<
92 asciidoc
-b docbook
-d manpage
-aversion
=$(VERSION
) $<
95 xmlto
-m manpage.xsl man
$<
98 asciidoc
-b xhtml11
-d manpage
$<
101 asciidoc
-b docbook
-d manpage
-aversion
=$(VERSION
) $<
104 xmlto
-m manpage.xsl man
$<
107 asciidoc
-b xhtml11
-d article
-n
$<
110 asciidoc
-b docbook
-d article
$<
112 %.html-chunked
: %.xml
119 cg commit
-m
"Merge with master"
121 cg commit
-m
"Sync docs"