1MAN1_TXT=$(wildcard git-*.txt) gitk.txt
2MAN7_TXT=git.txt
3
4DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
5DOC_HTML += glossary.html
6DOC_HTML += tutorial.html
7DOC_HTML += howto-index.html
8DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
9DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
10
11prefix=$(HOME)
12bin=$(prefix)/bin
13mandir=$(prefix)/man
14man1=$(mandir)/man1
15man7=$(mandir)/man7
16# DESTDIR=
17
18INSTALL=install
19
20#
21# Please note that there is a minor bug in asciidoc.
22# The version after 6.0.3 _will_ include the patch found here:
23# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
24#
25# Until that version is released you may have to apply the patch
26# yourself - yes, all 6 characters of it!
27#
28
29all: html man
30
31html: $(DOC_HTML)
32
33
34man: man1 man7
35man1: $(DOC_MAN1)
36man7: $(DOC_MAN7)
37
38install:
39 $(INSTALL) -m755 -d $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
40 $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
41 $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
42
43# 'include' dependencies
44git-diff-%.txt: diff-format.txt diff-options.txt
45 touch $@
46
47clean:
48 rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
49
50%.html : %.txt
51 asciidoc -b xhtml11 -d manpage $<
52
53%.1 %.7 : %.xml
54 xmlto man $<
55
56%.xml : %.txt
57 asciidoc -b docbook -d manpage $<
58
59glossary.html : glossary.txt sort_glossary.pl
60 cat $< | \
61 perl sort_glossary.pl | \
62 asciidoc -b xhtml11 - > glossary.html
63
64tutorial.html : tutorial.txt
65 asciidoc -b xhtml11 tutorial.txt
66
67howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
68 rm -f $@+ $@
69 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
70 mv $@+ $@
71
72howto-index.html: howto-index.txt
73 asciidoc -b xhtml11 howto-index.txt
74
75WEBDOC_DEST = /pub/software/scm/git/docs
76
77DOC_HTML += howto/revert-branch-rebase.html
78
79$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
80 rm -f $@+ $@
81 sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
82 mv $@+ $@
83
84install-webdoc : html
85 sh ./install-webdoc.sh $(WEBDOC_DEST)