]>
Commit | Line | Data |
---|---|---|
4a5d6939 MW |
1 | MAN1_TXT= \ |
2 | $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ | |
3 | $(wildcard git-*.txt)) \ | |
4 | gitk.txt | |
891dbc6e | 5 | MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt |
b2bf34d6 | 6 | MAN7_TXT=git.txt |
b790abb8 | 7 | |
4392da4d | 8 | DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) |
8db9307c | 9 | |
a1d4aa74 | 10 | ARTICLES = tutorial |
e31952da | 11 | ARTICLES += tutorial-2 |
dcc6e28f | 12 | ARTICLES += core-tutorial |
a1d4aa74 JH |
13 | ARTICLES += cvs-migration |
14 | ARTICLES += diffcore | |
15 | ARTICLES += howto-index | |
16 | ARTICLES += repository-layout | |
6d35cc76 | 17 | ARTICLES += hooks |
db9536c8 | 18 | ARTICLES += everyday |
4a5d6939 | 19 | ARTICLES += git-tools |
f562e6f3 | 20 | ARTICLES += glossary |
8db9307c | 21 | # with their own formatting rules. |
f562e6f3 | 22 | SP_ARTICLES = howto/revert-branch-rebase user-manual |
8db9307c JH |
23 | |
24 | DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) | |
789d5774 | 25 | |
b2bf34d6 | 26 | DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) |
2d76548b | 27 | DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT)) |
b2bf34d6 DG |
28 | DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) |
29 | ||
d2b8593f | 30 | prefix?=$(HOME) |
e14421b9 | 31 | bindir?=$(prefix)/bin |
45fd8bd3 | 32 | mandir?=$(prefix)/share/man |
7b8cf0cf | 33 | man1dir=$(mandir)/man1 |
4392da4d | 34 | man5dir=$(mandir)/man5 |
7b8cf0cf | 35 | man7dir=$(mandir)/man7 |
a682ef9f | 36 | # DESTDIR= |
87a81c83 | 37 | |
1187d756 | 38 | ASCIIDOC=asciidoc |
26cfcfbf | 39 | ASCIIDOC_EXTRA = |
d2b8593f | 40 | INSTALL?=install |
4cb08df5 | 41 | RM ?= rm -f |
6538d1ef | 42 | DOC_REF = origin/man |
87a81c83 | 43 | |
4739809c DK |
44 | infodir?=$(prefix)/share/info |
45 | MAKEINFO=makeinfo | |
46 | INSTALL_INFO=install-info | |
47 | DOCBOOK2X_TEXI=docbook2x-texi | |
c680dd83 JH |
48 | ifndef PERL_PATH |
49 | PERL_PATH = /usr/bin/perl | |
50 | endif | |
4739809c | 51 | |
95676853 | 52 | -include ../config.mak.autogen |
4fa96e15 | 53 | -include ../config.mak |
95676853 | 54 | |
7f55cf45 JF |
55 | ifdef ASCIIDOC8 |
56 | ASCIIDOC_EXTRA += -a asciidoc7compatible | |
57 | endif | |
58 | ifdef DOCBOOK_XSL_172 | |
59 | ASCIIDOC_EXTRA += -a docbook-xsl-172 | |
60 | endif | |
61 | ||
b2bf34d6 DG |
62 | # |
63 | # Please note that there is a minor bug in asciidoc. | |
64 | # The version after 6.0.3 _will_ include the patch found here: | |
65 | # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2 | |
66 | # | |
67 | # Until that version is released you may have to apply the patch | |
68 | # yourself - yes, all 6 characters of it! | |
69 | # | |
70 | ||
71 | all: html man | |
b790abb8 DG |
72 | |
73 | html: $(DOC_HTML) | |
74 | ||
4392da4d | 75 | $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf |
b2bf34d6 | 76 | |
4392da4d | 77 | man: man1 man5 man7 |
b2bf34d6 | 78 | man1: $(DOC_MAN1) |
4392da4d | 79 | man5: $(DOC_MAN5) |
b2bf34d6 | 80 | man7: $(DOC_MAN7) |
b790abb8 | 81 | |
4739809c DK |
82 | info: git.info |
83 | ||
b163512d | 84 | install: man |
41650765 RS |
85 | $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) |
86 | $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) | |
87 | $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) | |
88 | $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir) | |
89 | $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) | |
90 | $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) | |
87a81c83 | 91 | |
4739809c | 92 | install-info: info |
41650765 RS |
93 | $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) |
94 | $(INSTALL) -m 644 git.info $(DESTDIR)$(infodir) | |
4739809c DK |
95 | if test -r $(DESTDIR)$(infodir)/dir; then \ |
96 | $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\ | |
97 | else \ | |
98 | echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \ | |
99 | fi | |
37465016 | 100 | |
7b8a74f3 FL |
101 | ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
102 | $(MAKE) -C ../ GIT-VERSION-FILE | |
103 | ||
104 | -include ../GIT-VERSION-FILE | |
105 | ||
93d69d86 JL |
106 | # |
107 | # Determine "include::" file references in asciidoc files. | |
108 | # | |
fb612d54 | 109 | doc.dep : $(wildcard *.txt) build-docdep.perl |
4cb08df5 | 110 | $(RM) $@+ $@ |
c680dd83 | 111 | $(PERL_PATH) ./build-docdep.perl >$@+ |
a5ae8e64 | 112 | mv $@+ $@ |
93d69d86 | 113 | |
a5ae8e64 | 114 | -include doc.dep |
37465016 | 115 | |
72fe6a59 JH |
116 | cmds_txt = cmds-ancillaryinterrogators.txt \ |
117 | cmds-ancillarymanipulators.txt \ | |
118 | cmds-mainporcelain.txt \ | |
119 | cmds-plumbinginterrogators.txt \ | |
120 | cmds-plumbingmanipulators.txt \ | |
89bf2077 JH |
121 | cmds-synchingrepositories.txt \ |
122 | cmds-synchelpers.txt \ | |
123 | cmds-purehelpers.txt \ | |
124 | cmds-foreignscminterface.txt | |
72fe6a59 | 125 | |
d7907392 JH |
126 | $(cmds_txt): cmd-list.made |
127 | ||
79d30668 | 128 | cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) |
f9286765 | 129 | $(RM) $@ |
c680dd83 | 130 | $(PERL_PATH) ./cmd-list.perl ../command-list.txt |
d7907392 | 131 | date >$@ |
b790abb8 | 132 | |
40dac517 | 133 | git.7 git.html: git.txt |
93d69d86 | 134 | |
b790abb8 | 135 | clean: |
4739809c | 136 | $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep |
4cb08df5 | 137 | $(RM) $(cmds_txt) *.made |
b790abb8 DG |
138 | |
139 | %.html : %.txt | |
4cb08df5 | 140 | $(RM) $@+ $@ |
7b8a74f3 | 141 | $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \ |
4159c578 | 142 | $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< |
7b8a74f3 | 143 | mv $@+ $@ |
b790abb8 | 144 | |
4392da4d | 145 | %.1 %.5 %.7 : %.xml |
50cff52f | 146 | $(RM) $@ |
776e994a | 147 | xmlto -m callouts.xsl man $< |
b790abb8 DG |
148 | |
149 | %.xml : %.txt | |
4cb08df5 | 150 | $(RM) $@+ $@ |
7b8a74f3 | 151 | $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \ |
4159c578 | 152 | $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< |
7b8a74f3 | 153 | mv $@+ $@ |
3f971fc4 | 154 | |
d19fbc3c | 155 | user-manual.xml: user-manual.txt user-manual.conf |
1187d756 | 156 | $(ASCIIDOC) -b docbook -d book $< |
d19fbc3c | 157 | |
1cffddd6 | 158 | XSLT = docbook.xsl |
0a3985dc | 159 | XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css |
1c95c565 | 160 | |
d19fbc3c | 161 | user-manual.html: user-manual.xml |
1c95c565 | 162 | xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< |
d19fbc3c | 163 | |
4739809c DK |
164 | git.info: user-manual.xml |
165 | $(RM) $@ $*.texi $*.texi+ | |
166 | $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+ | |
c680dd83 | 167 | $(PERL_PATH) fix-texi.perl <$*.texi+ >$*.texi |
4739809c DK |
168 | $(MAKEINFO) --no-split $*.texi |
169 | $(RM) $*.texi $*.texi+ | |
170 | ||
e6fc2346 | 171 | howto-index.txt: howto-index.sh $(wildcard howto/*.txt) |
4cb08df5 | 172 | $(RM) $@+ $@ |
e6fc2346 JH |
173 | sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ |
174 | mv $@+ $@ | |
175 | ||
8db9307c | 176 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
1187d756 | 177 | $(ASCIIDOC) -b xhtml11 $*.txt |
e6fc2346 JH |
178 | |
179 | WEBDOC_DEST = /pub/software/scm/git/docs | |
180 | ||
8d0991d7 | 181 | $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt |
4cb08df5 | 182 | $(RM) $@+ $@ |
1187d756 | 183 | sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ |
8d0991d7 JH |
184 | mv $@+ $@ |
185 | ||
e6fc2346 JH |
186 | install-webdoc : html |
187 | sh ./install-webdoc.sh $(WEBDOC_DEST) | |
6538d1ef EW |
188 | |
189 | quick-install: | |
190 | sh ./install-doc-quick.sh $(DOC_REF) $(mandir) | |
7b8a74f3 FL |
191 | |
192 | .PHONY: .FORCE-GIT-VERSION-FILE |