]>
Commit | Line | Data |
---|---|---|
4a5d6939 MW |
1 | MAN1_TXT= \ |
2 | $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ | |
3 | $(wildcard git-*.txt)) \ | |
4 | gitk.txt | |
b2bf34d6 | 5 | MAN7_TXT=git.txt |
b790abb8 | 6 | |
2a29da7c | 7 | DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) |
8db9307c | 8 | |
a1d4aa74 | 9 | ARTICLES = tutorial |
e31952da | 10 | ARTICLES += tutorial-2 |
dcc6e28f | 11 | ARTICLES += core-tutorial |
a1d4aa74 JH |
12 | ARTICLES += cvs-migration |
13 | ARTICLES += diffcore | |
14 | ARTICLES += howto-index | |
15 | ARTICLES += repository-layout | |
6d35cc76 | 16 | ARTICLES += hooks |
db9536c8 | 17 | ARTICLES += everyday |
4a5d6939 | 18 | ARTICLES += git-tools |
f562e6f3 | 19 | ARTICLES += glossary |
8db9307c | 20 | # with their own formatting rules. |
f562e6f3 | 21 | SP_ARTICLES = howto/revert-branch-rebase user-manual |
8db9307c JH |
22 | |
23 | DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) | |
789d5774 | 24 | |
b2bf34d6 DG |
25 | DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) |
26 | DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) | |
27 | ||
d2b8593f | 28 | prefix?=$(HOME) |
e14421b9 JN |
29 | bindir?=$(prefix)/bin |
30 | mandir?=$(prefix)/man | |
7b8cf0cf JN |
31 | man1dir=$(mandir)/man1 |
32 | man7dir=$(mandir)/man7 | |
a682ef9f | 33 | # DESTDIR= |
87a81c83 | 34 | |
1187d756 | 35 | ASCIIDOC=asciidoc |
26cfcfbf | 36 | ASCIIDOC_EXTRA = |
d2b8593f | 37 | INSTALL?=install |
6538d1ef | 38 | DOC_REF = origin/man |
87a81c83 | 39 | |
95676853 | 40 | -include ../config.mak.autogen |
4fa96e15 | 41 | -include ../config.mak |
95676853 | 42 | |
b2bf34d6 DG |
43 | # |
44 | # Please note that there is a minor bug in asciidoc. | |
45 | # The version after 6.0.3 _will_ include the patch found here: | |
46 | # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2 | |
47 | # | |
48 | # Until that version is released you may have to apply the patch | |
49 | # yourself - yes, all 6 characters of it! | |
50 | # | |
51 | ||
52 | all: html man | |
b790abb8 DG |
53 | |
54 | html: $(DOC_HTML) | |
55 | ||
c7543ce0 | 56 | $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf |
b2bf34d6 DG |
57 | |
58 | man: man1 man7 | |
59 | man1: $(DOC_MAN1) | |
60 | man7: $(DOC_MAN7) | |
b790abb8 | 61 | |
b163512d | 62 | install: man |
7b8cf0cf | 63 | $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) |
d44c92d6 CW |
64 | $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir) |
65 | $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir) | |
87a81c83 | 66 | |
37465016 | 67 | |
93d69d86 JL |
68 | # |
69 | # Determine "include::" file references in asciidoc files. | |
70 | # | |
fb612d54 | 71 | doc.dep : $(wildcard *.txt) build-docdep.perl |
a5ae8e64 JH |
72 | rm -f $@+ $@ |
73 | perl ./build-docdep.perl >$@+ | |
74 | mv $@+ $@ | |
93d69d86 | 75 | |
a5ae8e64 | 76 | -include doc.dep |
37465016 | 77 | |
72fe6a59 JH |
78 | cmds_txt = cmds-ancillaryinterrogators.txt \ |
79 | cmds-ancillarymanipulators.txt \ | |
80 | cmds-mainporcelain.txt \ | |
81 | cmds-plumbinginterrogators.txt \ | |
82 | cmds-plumbingmanipulators.txt \ | |
89bf2077 JH |
83 | cmds-synchingrepositories.txt \ |
84 | cmds-synchelpers.txt \ | |
85 | cmds-purehelpers.txt \ | |
86 | cmds-foreignscminterface.txt | |
72fe6a59 | 87 | |
be93fc08 | 88 | $(cmds_txt): cmd-list.perl $(MAN1_TXT) |
72fe6a59 | 89 | perl ./cmd-list.perl |
b790abb8 | 90 | |
72fe6a59 | 91 | git.7 git.html: git.txt core-intro.txt |
93d69d86 | 92 | |
b790abb8 | 93 | clean: |
556b6600 | 94 | rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep |
72fe6a59 | 95 | rm -f $(cmds_txt) |
b790abb8 DG |
96 | |
97 | %.html : %.txt | |
26cfcfbf | 98 | $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $< |
b790abb8 | 99 | |
7984eabe | 100 | %.1 %.7 : %.xml |
776e994a | 101 | xmlto -m callouts.xsl man $< |
b790abb8 DG |
102 | |
103 | %.xml : %.txt | |
1187d756 | 104 | $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $< |
3f971fc4 | 105 | |
d19fbc3c | 106 | user-manual.xml: user-manual.txt user-manual.conf |
1187d756 | 107 | $(ASCIIDOC) -b docbook -d book $< |
d19fbc3c | 108 | |
1c95c565 | 109 | XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl |
0a3985dc | 110 | XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css |
1c95c565 | 111 | |
d19fbc3c | 112 | user-manual.html: user-manual.xml |
1c95c565 | 113 | xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< |
d19fbc3c | 114 | |
e6fc2346 JH |
115 | howto-index.txt: howto-index.sh $(wildcard howto/*.txt) |
116 | rm -f $@+ $@ | |
117 | sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ | |
118 | mv $@+ $@ | |
119 | ||
8db9307c | 120 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
1187d756 | 121 | $(ASCIIDOC) -b xhtml11 $*.txt |
e6fc2346 JH |
122 | |
123 | WEBDOC_DEST = /pub/software/scm/git/docs | |
124 | ||
8d0991d7 JH |
125 | $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt |
126 | rm -f $@+ $@ | |
1187d756 | 127 | sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ |
8d0991d7 JH |
128 | mv $@+ $@ |
129 | ||
e6fc2346 JH |
130 | install-webdoc : html |
131 | sh ./install-webdoc.sh $(WEBDOC_DEST) | |
6538d1ef EW |
132 | |
133 | quick-install: | |
134 | sh ./install-doc-quick.sh $(DOC_REF) $(mandir) |