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