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 README.html \
14 ifneq (,$(wildcard .git
))
15 VERSION
= $(shell git-describe
)
16 WTDIRTY
= $(shell git-diff-index
--name-only HEAD
2>/dev
/null
)
17 CFLAGS
+= '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
22 all-debug
: CFLAGS
+= $(DFLAGS
)
26 for prog in
$(PROGS
); do \
27 install $$prog $(DESTDIR
)$(bindir); \
31 mkdir
-p
$(DESTDIR
)$(mandir)/man1 \
32 $(DESTDIR
)$(mandir)/man5 \
33 $(DESTDIR
)$(docdir
)/tig
34 for doc in
$(DOCS
); do \
36 *.1) install $$doc $(DESTDIR
)$(mandir)/man1
;; \
37 *.5) install $$doc $(DESTDIR
)$(mandir)/man5
;; \
38 *.html
) install $$doc $(DESTDIR
)$(docdir
)/tig
;; \
43 rm -rf manual.html-chunked
44 rm -f
$(PROGS
) $(DOCS
) core
47 aspell
--lang
=en
--check tig
.1.txt tigrc
.5.txt manual.txt
52 .PHONY
: all all-debug doc
install install-doc
clean spell-check
54 manual.toc
: manual.txt
55 sed
-n
'/^\[\[/,/\(---\|~~~\)/p' < $< | while read line
; do \
57 "-----"*) echo
". <<$$ref>>"; ref
= ;; \
58 "~~~~~"*) echo
"- <<$$ref>>"; ref
= ;; \
59 "[["*"]]") ref
="$$line" ;; \
60 *) ref
="$$ref, $$line" ;; \
61 esac
; done | sed
's/\[\[\(.*\)\]\]/\1/' > $@
66 asciidoc
-b xhtml11
-d article
-a readme
$<
69 asciidoc
-b xhtml11
-d manpage
$<
72 asciidoc
-b docbook
-d manpage
$<
78 asciidoc
-b xhtml11
-d manpage
$<
81 asciidoc
-b docbook
-d manpage
$<
87 asciidoc
-b xhtml11
-d article
-n
$<
90 asciidoc
-b docbook
-d article
$<
92 %.html-chunked
: %.xml
99 cg commit
-m
"Merge with master"
101 cg commit
-m
"Sync docs"