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