]>
Commit | Line | Data |
---|---|---|
8df786d2 ÆAB |
1 | # Import tree-wide shared Makefile behavior and libraries |
2 | include ../shared.mak | |
3 | ||
a617578d JK |
4 | # Guard against environment variables |
5 | MAN1_TXT = | |
6 | MAN5_TXT = | |
7 | MAN7_TXT = | |
824c621b | 8 | HOWTO_TXT = |
19bcc73e | 9 | DOC_DEP_TXT = |
43cc5ce9 JH |
10 | TECH_DOCS = |
11 | ARTICLES = | |
12 | SP_ARTICLES = | |
5a568ea0 | 13 | OBSOLETE_HTML = |
a617578d | 14 | |
faa7a096 JS |
15 | -include GIT-EXCLUDED-PROGRAMS |
16 | ||
a617578d | 17 | MAN1_TXT += $(filter-out \ |
faa7a096 | 18 | $(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \ |
a617578d JK |
19 | $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ |
20 | $(wildcard git-*.txt)) | |
21 | MAN1_TXT += git.txt | |
22 | MAN1_TXT += gitk.txt | |
23 | MAN1_TXT += gitweb.txt | |
7b5c93c6 | 24 | MAN1_TXT += scalar.txt |
a617578d | 25 | |
2135e1ad | 26 | # man5 / man7 guides (note: new guides should also be added to command-list.txt) |
a617578d | 27 | MAN5_TXT += gitattributes.txt |
844739ba | 28 | MAN5_TXT += gitformat-bundle.txt |
977c47b4 | 29 | MAN5_TXT += gitformat-chunk.txt |
8cbace93 | 30 | MAN5_TXT += gitformat-commit-graph.txt |
00d3e8d7 | 31 | MAN5_TXT += gitformat-index.txt |
977c47b4 | 32 | MAN5_TXT += gitformat-pack.txt |
20516890 | 33 | MAN5_TXT += gitformat-signature.txt |
a617578d JK |
34 | MAN5_TXT += githooks.txt |
35 | MAN5_TXT += gitignore.txt | |
42957af0 | 36 | MAN5_TXT += gitmailmap.txt |
a617578d | 37 | MAN5_TXT += gitmodules.txt |
5db92105 ÆAB |
38 | MAN5_TXT += gitprotocol-capabilities.txt |
39 | MAN5_TXT += gitprotocol-common.txt | |
1e232016 | 40 | MAN5_TXT += gitprotocol-http.txt |
5db92105 ÆAB |
41 | MAN5_TXT += gitprotocol-pack.txt |
42 | MAN5_TXT += gitprotocol-v2.txt | |
a617578d JK |
43 | MAN5_TXT += gitrepository-layout.txt |
44 | MAN5_TXT += gitweb.conf.txt | |
45 | ||
46 | MAN7_TXT += gitcli.txt | |
47 | MAN7_TXT += gitcore-tutorial.txt | |
a6fc9fd3 | 48 | MAN7_TXT += gitcredentials.txt |
a617578d JK |
49 | MAN7_TXT += gitcvs-migration.txt |
50 | MAN7_TXT += gitdiffcore.txt | |
673151a9 | 51 | MAN7_TXT += giteveryday.txt |
2149b674 | 52 | MAN7_TXT += gitfaq.txt |
a617578d JK |
53 | MAN7_TXT += gitglossary.txt |
54 | MAN7_TXT += gitnamespaces.txt | |
439cc746 | 55 | MAN7_TXT += gitremote-helpers.txt |
a617578d | 56 | MAN7_TXT += gitrevisions.txt |
d4803455 | 57 | MAN7_TXT += gitsubmodules.txt |
a617578d JK |
58 | MAN7_TXT += gittutorial-2.txt |
59 | MAN7_TXT += gittutorial.txt | |
60 | MAN7_TXT += gitworkflows.txt | |
b790abb8 | 61 | |
824c621b ÆAB |
62 | HOWTO_TXT += $(wildcard howto/*.txt) |
63 | ||
19bcc73e ÆAB |
64 | DOC_DEP_TXT += $(wildcard *.txt) |
65 | DOC_DEP_TXT += $(wildcard config/*.txt) | |
18d89fe2 | 66 | DOC_DEP_TXT += $(wildcard includes/*.txt) |
19bcc73e | 67 | |
3d5b568f JNA |
68 | ifdef MAN_FILTER |
69 | MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) | |
70 | else | |
5cefc33b | 71 | MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) |
3d5b568f JNA |
72 | MAN_FILTER = $(MAN_TXT) |
73 | endif | |
74 | ||
692cfd6b JK |
75 | MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT)) |
76 | MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) | |
65289e9d | 77 | GIT_MAN_REF = master |
5cefc33b | 78 | |
673151a9 | 79 | OBSOLETE_HTML += everyday.html |
5a568ea0 | 80 | OBSOLETE_HTML += git-remote-helpers.html |
8db9307c | 81 | |
43cc5ce9 | 82 | ARTICLES += howto-index |
4a5d6939 | 83 | ARTICLES += git-tools |
69a9cd31 | 84 | ARTICLES += git-bisect-lk2009 |
8db9307c | 85 | # with their own formatting rules. |
43cc5ce9 | 86 | SP_ARTICLES += user-manual |
81670e9b | 87 | SP_ARTICLES += howto/new-command |
11b17afc JH |
88 | SP_ARTICLES += howto/revert-branch-rebase |
89 | SP_ARTICLES += howto/using-merge-subtree | |
90 | SP_ARTICLES += howto/using-signed-tag-in-pull-request | |
5e00439f TA |
91 | SP_ARTICLES += howto/use-git-daemon |
92 | SP_ARTICLES += howto/update-hook-example | |
93 | SP_ARTICLES += howto/setup-git-server-over-http | |
94 | SP_ARTICLES += howto/separating-topic-branches | |
95 | SP_ARTICLES += howto/revert-a-faulty-merge | |
96 | SP_ARTICLES += howto/recover-corrupted-blob-object | |
41dfbb2d | 97 | SP_ARTICLES += howto/recover-corrupted-object-harder |
5e00439f | 98 | SP_ARTICLES += howto/rebuild-from-update-hook |
5e00439f | 99 | SP_ARTICLES += howto/rebase-from-internal-branch |
0678b649 | 100 | SP_ARTICLES += howto/keep-canonical-history-correct |
5e00439f | 101 | SP_ARTICLES += howto/maintain-git |
09420b76 | 102 | SP_ARTICLES += howto/coordinate-embargoed-releases |
530e741c JH |
103 | API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt))) |
104 | SP_ARTICLES += $(API_DOCS) | |
5e00439f | 105 | |
e01b8519 | 106 | TECH_DOCS += ReviewingGuidelines |
76644e32 | 107 | TECH_DOCS += MyFirstContribution |
e0479fa0 | 108 | TECH_DOCS += MyFirstObjectWalk |
049e64aa | 109 | TECH_DOCS += SubmittingPatches |
7a06a854 | 110 | TECH_DOCS += ToolsForGit |
accf237a | 111 | TECH_DOCS += technical/bitmap-format |
2da14fad | 112 | TECH_DOCS += technical/bundle-uri |
752414ae | 113 | TECH_DOCS += technical/hash-function-transition |
addad105 | 114 | TECH_DOCS += technical/long-running-process-protocol |
60568178 | 115 | TECH_DOCS += technical/multi-pack-index |
5e00439f | 116 | TECH_DOCS += technical/pack-heuristics |
68e66f29 | 117 | TECH_DOCS += technical/parallel-checkout |
5641eb94 | 118 | TECH_DOCS += technical/partial-clone |
5e00439f | 119 | TECH_DOCS += technical/racy-git |
35e6c474 | 120 | TECH_DOCS += technical/reftable |
9eb7a731 | 121 | TECH_DOCS += technical/scalar |
5e00439f TA |
122 | TECH_DOCS += technical/send-pack-pipeline |
123 | TECH_DOCS += technical/shallow | |
124 | TECH_DOCS += technical/trivial-merge | |
125 | SP_ARTICLES += $(TECH_DOCS) | |
530e741c | 126 | SP_ARTICLES += technical/api-index |
8db9307c | 127 | |
3d5b568f JNA |
128 | ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) |
129 | HTML_FILTER ?= $(ARTICLES_HTML) $(OBSOLETE_HTML) | |
130 | DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(ARTICLES_HTML) $(OBSOLETE_HTML)) | |
789d5774 | 131 | |
3d5b568f JNA |
132 | DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER),$(MAN1_TXT))) |
133 | DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER),$(MAN5_TXT))) | |
134 | DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER),$(MAN7_TXT))) | |
b2bf34d6 | 135 | |
692cfd6b JK |
136 | prefix ?= $(HOME) |
137 | bindir ?= $(prefix)/bin | |
138 | htmldir ?= $(prefix)/share/doc/git-doc | |
e21db2c6 | 139 | infodir ?= $(prefix)/share/info |
692cfd6b JK |
140 | pdfdir ?= $(prefix)/share/doc/git-doc |
141 | mandir ?= $(prefix)/share/man | |
142 | man1dir = $(mandir)/man1 | |
143 | man5dir = $(mandir)/man5 | |
144 | man7dir = $(mandir)/man7 | |
145 | # DESTDIR = | |
87a81c83 | 146 | |
dd4f3075 | 147 | ASCIIDOC = asciidoc |
26cfcfbf | 148 | ASCIIDOC_EXTRA = |
7d61547d | 149 | ASCIIDOC_HTML = xhtml11 |
150 | ASCIIDOC_DOCBOOK = docbook | |
151 | ASCIIDOC_CONF = -f asciidoc.conf | |
da8a3664 | 152 | ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \ |
226daba2 MÅ |
153 | -amanversion=$(GIT_VERSION) \ |
154 | -amanmanual='Git Manual' -amansource='Git' | |
56da2139 | 155 | ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS |
da8a3664 | 156 | TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML) |
157 | TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK) | |
c30e9485 | 158 | MANPAGE_XSL = manpage-normal.xsl |
dd4f3075 | 159 | XMLTO = xmlto |
5121a6d9 | 160 | XMLTO_EXTRA = |
692cfd6b | 161 | INSTALL ?= install |
4cb08df5 | 162 | RM ?= rm -f |
fcbebfdd JH |
163 | MAN_REPO = ../../git-manpages |
164 | HTML_REPO = ../../git-htmldocs | |
87a81c83 | 165 | |
692cfd6b JK |
166 | MAKEINFO = makeinfo |
167 | INSTALL_INFO = install-info | |
168 | DOCBOOK2X_TEXI = docbook2x-texi | |
169 | DBLATEX = dblatex | |
0079d6eb | 170 | ASCIIDOC_DBLATEX_DIR = /etc/asciidoc/dblatex |
ae4e3e8d | 171 | DBLATEX_COMMON = -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty |
c680dd83 JH |
172 | ifndef PERL_PATH |
173 | PERL_PATH = /usr/bin/perl | |
174 | endif | |
4739809c | 175 | |
95676853 | 176 | -include ../config.mak.autogen |
4fa96e15 | 177 | -include ../config.mak |
95676853 | 178 | |
59457170 | 179 | ifndef NO_MAN_BOLD_LITERAL |
5121a6d9 CJ |
180 | XMLTO_EXTRA += -m manpage-bold-literal.xsl |
181 | endif | |
7f55cf45 | 182 | |
8dd35c71 | 183 | # Newer DocBook stylesheet emits warning cruft in the output when |
50d9bbba TZ |
184 | # this is not set, and if set it shows an absolute link. Older |
185 | # stylesheets simply ignore this parameter. | |
59a0a0bd | 186 | # |
50d9bbba TZ |
187 | # Distros may want to use MAN_BASE_URL=file:///path/to/git/docs/ |
188 | # or similar. | |
189 | ifndef MAN_BASE_URL | |
190 | MAN_BASE_URL = file://$(htmldir)/ | |
59a0a0bd | 191 | endif |
50d9bbba | 192 | XMLTO_EXTRA += -m manpage-base-url.xsl |
a479a564 | 193 | |
204d363f TR |
194 | # If your target system uses GNU groff, it may try to render |
195 | # apostrophes as a "pretty" apostrophe using unicode. This breaks | |
196 | # cut&paste, so you should set GNU_ROFF to force them to be ASCII | |
197 | # apostrophes. Unfortunately does not work with non-GNU roff. | |
198 | ifdef GNU_ROFF | |
199 | XMLTO_EXTRA += -m manpage-quote-apos.xsl | |
200 | endif | |
201 | ||
ec3366eb | 202 | ifdef USE_ASCIIDOCTOR |
203 | ASCIIDOC = asciidoctor | |
204 | ASCIIDOC_CONF = | |
205 | ASCIIDOC_HTML = xhtml5 | |
f6461b82 | 206 | ASCIIDOC_DOCBOOK = docbook5 |
743e63f3 | 207 | ASCIIDOC_EXTRA += -acompat-mode -atabsize=8 |
55d2d812 | 208 | ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions |
ec3366eb | 209 | ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;' |
56da2139 | 210 | ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS |
ec3366eb | 211 | DBLATEX_COMMON = |
f6461b82 | 212 | XMLTO_EXTRA += --skip-validation |
213 | XMLTO_EXTRA += -x manpage.xsl | |
ec3366eb | 214 | endif |
215 | ||
ee7ec2f9 BW |
216 | SHELL_PATH ?= $(SHELL) |
217 | # Shell quote; | |
218 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) | |
219 | ||
5b58619a JN |
220 | ifdef DEFAULT_PAGER |
221 | DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER)) | |
222 | ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)' | |
223 | endif | |
224 | ||
225 | ifdef DEFAULT_EDITOR | |
226 | DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR)) | |
227 | ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)' | |
228 | endif | |
229 | ||
b2bf34d6 | 230 | all: html man |
b790abb8 DG |
231 | |
232 | html: $(DOC_HTML) | |
233 | ||
4392da4d | 234 | man: man1 man5 man7 |
b2bf34d6 | 235 | man1: $(DOC_MAN1) |
4392da4d | 236 | man5: $(DOC_MAN5) |
b2bf34d6 | 237 | man7: $(DOC_MAN7) |
b790abb8 | 238 | |
5cefc33b | 239 | info: git.info gitman.info |
4739809c | 240 | |
a325a1a7 MV |
241 | pdf: user-manual.pdf |
242 | ||
b1a46b70 MH |
243 | install: install-man |
244 | ||
245 | install-man: man | |
41650765 RS |
246 | $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) |
247 | $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) | |
248 | $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) | |
249 | $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir) | |
250 | $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) | |
251 | $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) | |
87a81c83 | 252 | |
4739809c | 253 | install-info: info |
41650765 | 254 | $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) |
5cefc33b | 255 | $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir) |
4739809c DK |
256 | if test -r $(DESTDIR)$(infodir)/dir; then \ |
257 | $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\ | |
5cefc33b | 258 | $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\ |
4739809c DK |
259 | else \ |
260 | echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \ | |
261 | fi | |
37465016 | 262 | |
a325a1a7 MV |
263 | install-pdf: pdf |
264 | $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir) | |
265 | $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir) | |
266 | ||
5d6491c7 | 267 | install-html: html |
ee7ec2f9 | 268 | '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir) |
5d6491c7 | 269 | |
13fca9f3 | 270 | ../GIT-VERSION-FILE: FORCE |
bb230097 | 271 | $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE |
7b8a74f3 | 272 | |
8cc804d0 | 273 | ifneq ($(filter-out lint-docs clean,$(MAKECMDGOALS)),) |
7b8a74f3 | 274 | -include ../GIT-VERSION-FILE |
7a9272a8 | 275 | endif |
7b8a74f3 | 276 | |
93d69d86 JL |
277 | # |
278 | # Determine "include::" file references in asciidoc files. | |
279 | # | |
f35ec546 DA |
280 | docdep_prereqs = \ |
281 | mergetools-list.made $(mergetools_txt) \ | |
282 | cmd-list.made $(cmds_txt) | |
283 | ||
19bcc73e | 284 | doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl |
db10fc6c | 285 | $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl >$@ $(QUIET_STDERR) |
93d69d86 | 286 | |
54df8755 | 287 | ifneq ($(MAKECMDGOALS),clean) |
a5ae8e64 | 288 | -include doc.dep |
54df8755 | 289 | endif |
37465016 | 290 | |
72fe6a59 JH |
291 | cmds_txt = cmds-ancillaryinterrogators.txt \ |
292 | cmds-ancillarymanipulators.txt \ | |
293 | cmds-mainporcelain.txt \ | |
294 | cmds-plumbinginterrogators.txt \ | |
295 | cmds-plumbingmanipulators.txt \ | |
89bf2077 JH |
296 | cmds-synchingrepositories.txt \ |
297 | cmds-synchelpers.txt \ | |
f442f28a | 298 | cmds-guide.txt \ |
844739ba | 299 | cmds-developerinterfaces.txt \ |
d976c510 | 300 | cmds-userinterfaces.txt \ |
89bf2077 JH |
301 | cmds-purehelpers.txt \ |
302 | cmds-foreignscminterface.txt | |
72fe6a59 | 303 | |
d7907392 JH |
304 | $(cmds_txt): cmd-list.made |
305 | ||
79d30668 | 306 | cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) |
471e7b2c | 307 | $(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \ |
d7907392 | 308 | date >$@ |
b790abb8 | 309 | |
f35ec546 DA |
310 | mergetools_txt = mergetools-diff.txt mergetools-merge.txt |
311 | ||
312 | $(mergetools_txt): mergetools-list.made | |
313 | ||
314 | mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*) | |
471e7b2c | 315 | $(QUIET_GEN) \ |
7b5cf8be | 316 | $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=diff && \ |
f35ec546 | 317 | . ../git-mergetool--lib.sh && \ |
7b5cf8be FR |
318 | show_tool_names can_diff' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-diff.txt && \ |
319 | $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=merge && \ | |
f35ec546 | 320 | . ../git-mergetool--lib.sh && \ |
7b5cf8be | 321 | show_tool_names can_merge' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-merge.txt && \ |
f35ec546 DA |
322 | date >$@ |
323 | ||
9a71722b MÅ |
324 | TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK)) |
325 | ||
326 | GIT-ASCIIDOCFLAGS: FORCE | |
327 | @FLAGS='$(TRACK_ASCIIDOCFLAGS)'; \ | |
328 | if test x"$$FLAGS" != x"`cat GIT-ASCIIDOCFLAGS 2>/dev/null`" ; then \ | |
329 | echo >&2 " * new asciidoc flags"; \ | |
330 | echo "$$FLAGS" >GIT-ASCIIDOCFLAGS; \ | |
331 | fi | |
332 | ||
b790abb8 | 333 | clean: |
8650c629 | 334 | $(RM) -rf .build/ |
4c785e50 | 335 | $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 |
c6a5ad21 | 336 | $(RM) *.texi *.texi+ *.texi++ git.info gitman.info |
ae8044a2 | 337 | $(RM) *.pdf |
530e741c | 338 | $(RM) howto-index.txt howto/*.html doc.dep |
5e00439f | 339 | $(RM) technical/*.html technical/api-index.txt |
049e64aa | 340 | $(RM) SubmittingPatches.txt |
f35ec546 | 341 | $(RM) $(cmds_txt) $(mergetools_txt) *.made |
50d9bbba | 342 | $(RM) manpage-base-url.xsl |
9a71722b | 343 | $(RM) GIT-ASCIIDOCFLAGS |
b790abb8 | 344 | |
12d078ed | 345 | $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS) |
db10fc6c | 346 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $< |
b790abb8 | 347 | |
12d078ed | 348 | $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) |
db10fc6c | 349 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $< |
bd4a3d61 | 350 | |
50d9bbba | 351 | manpage-base-url.xsl: manpage-base-url.xsl.in |
96a7501a | 352 | $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@ |
50d9bbba | 353 | |
c91d03aa | 354 | %.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl) |
471e7b2c | 355 | $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< |
b790abb8 | 356 | |
12d078ed | 357 | %.xml : %.txt $(ASCIIDOC_DEPS) |
db10fc6c | 358 | $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $< |
3f971fc4 | 359 | |
08c9757a | 360 | user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS |
db10fc6c | 361 | $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $< |
d19fbc3c | 362 | |
530e741c JH |
363 | technical/api-index.txt: technical/api-index-skel.txt \ |
364 | technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS)) | |
ee7ec2f9 | 365 | $(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh |
530e741c | 366 | |
fe77b416 | 367 | technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ |
9a71722b MÅ |
368 | $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt \ |
369 | asciidoc.conf GIT-ASCIIDOCFLAGS | |
da8a3664 | 370 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt |
530e741c | 371 | |
049e64aa | 372 | SubmittingPatches.txt: SubmittingPatches |
373 | $(QUIET_GEN) cp $< $@ | |
374 | ||
1cffddd6 | 375 | XSLT = docbook.xsl |
3569e11d AE |
376 | XSLTOPTS = |
377 | XSLTOPTS += --xinclude | |
378 | XSLTOPTS += --stringparam html.stylesheet docbook-xsl.css | |
379 | XSLTOPTS += --param generate.consistent.ids 1 | |
1c95c565 | 380 | |
f2aff316 | 381 | user-manual.html: user-manual.xml $(XSLT) |
db10fc6c | 382 | $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< |
d19fbc3c | 383 | |
50b3555c | 384 | git.info: user-manual.texi |
bb230097 | 385 | $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi |
5cefc33b | 386 | |
50b3555c | 387 | user-manual.texi: user-manual.xml |
db10fc6c FC |
388 | $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \ |
389 | $(PERL_PATH) fix-texi.perl <$@+ >$@ && \ | |
7ba30167 | 390 | $(RM) $@+ |
5cefc33b | 391 | |
a325a1a7 | 392 | user-manual.pdf: user-manual.xml |
db10fc6c | 393 | $(QUIET_DBLATEX)$(DBLATEX) -o $@ $(DBLATEX_COMMON) $< |
a325a1a7 | 394 | |
95e5efc6 | 395 | gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl |
471e7b2c | 396 | $(QUIET_DB2TEXI) \ |
95e5efc6 | 397 | ($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \ |
398 | $(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \ | |
7ba30167 | 399 | $(RM) $(xml)+ &&) true) > $@+ && \ |
db10fc6c | 400 | $(PERL_PATH) cat-texi.perl $@ <$@+ >$@ && \ |
7ba30167 | 401 | $(RM) $@+ |
5cefc33b JH |
402 | |
403 | gitman.info: gitman.texi | |
8af0699b | 404 | $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $< |
5cefc33b JH |
405 | |
406 | $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml | |
db10fc6c | 407 | $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@ |
4739809c | 408 | |
824c621b | 409 | howto-index.txt: howto-index.sh $(HOWTO_TXT) |
db10fc6c | 410 | $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@ |
e6fc2346 | 411 | |
8db9307c | 412 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
da8a3664 | 413 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt |
e6fc2346 JH |
414 | |
415 | WEBDOC_DEST = /pub/software/scm/git/docs | |
416 | ||
fe77b416 | 417 | howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ |
824c621b | 418 | $(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt GIT-ASCIIDOCFLAGS |
471e7b2c | 419 | $(QUIET_ASCIIDOC) \ |
7d61547d | 420 | sed -e '1,/^$$/d' $< | \ |
db10fc6c | 421 | $(TXT_TO_HTML) - >$@ |
8d0991d7 | 422 | |
e6fc2346 | 423 | install-webdoc : html |
ee7ec2f9 | 424 | '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST) |
6538d1ef | 425 | |
2de9b711 TA |
426 | # You must have a clone of 'git-htmldocs' and 'git-manpages' repositories |
427 | # next to the 'git' repository itself for the following to work. | |
fcbebfdd | 428 | |
b1a46b70 MH |
429 | quick-install: quick-install-man |
430 | ||
fcbebfdd JH |
431 | require-manrepo:: |
432 | @if test ! -d $(MAN_REPO); \ | |
433 | then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi | |
434 | ||
435 | quick-install-man: require-manrepo | |
65289e9d | 436 | '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir) $(GIT_MAN_REF) |
fcbebfdd JH |
437 | |
438 | require-htmlrepo:: | |
439 | @if test ! -d $(HTML_REPO); \ | |
440 | then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi | |
7b8a74f3 | 441 | |
fcbebfdd | 442 | quick-install-html: require-htmlrepo |
65289e9d | 443 | '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir) $(GIT_MAN_REF) |
6fe570de | 444 | |
5fafce0b JK |
445 | print-man1: |
446 | @for i in $(MAN1_TXT); do echo $$i; done | |
447 | ||
8650c629 | 448 | ## Lint: gitlink |
8650c629 | 449 | LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT)) |
8650c629 ÆAB |
450 | $(LINT_DOCS_GITLINK): lint-gitlink.perl |
451 | $(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt | |
0b6d0bc9 | 452 | $(call mkdir_p_parent_template) |
8650c629 ÆAB |
453 | $(QUIET_LINT_GITLINK)$(PERL_PATH) lint-gitlink.perl \ |
454 | $< \ | |
d2c99080 ÆAB |
455 | $(HOWTO_TXT) $(DOC_DEP_TXT) \ |
456 | --section=1 $(MAN1_TXT) \ | |
457 | --section=5 $(MAN5_TXT) \ | |
8650c629 ÆAB |
458 | --section=7 $(MAN7_TXT) >$@ |
459 | .PHONY: lint-docs-gitlink | |
460 | lint-docs-gitlink: $(LINT_DOCS_GITLINK) | |
461 | ||
462 | ## Lint: man-end-blurb | |
8650c629 | 463 | LINT_DOCS_MAN_END_BLURB = $(patsubst %.txt,.build/lint-docs/man-end-blurb/%.ok,$(MAN_TXT)) |
8650c629 ÆAB |
464 | $(LINT_DOCS_MAN_END_BLURB): lint-man-end-blurb.perl |
465 | $(LINT_DOCS_MAN_END_BLURB): .build/lint-docs/man-end-blurb/%.ok: %.txt | |
0b6d0bc9 | 466 | $(call mkdir_p_parent_template) |
8650c629 ÆAB |
467 | $(QUIET_LINT_MANEND)$(PERL_PATH) lint-man-end-blurb.perl $< >$@ |
468 | .PHONY: lint-docs-man-end-blurb | |
8650c629 ÆAB |
469 | |
470 | ## Lint: man-section-order | |
8650c629 | 471 | LINT_DOCS_MAN_SECTION_ORDER = $(patsubst %.txt,.build/lint-docs/man-section-order/%.ok,$(MAN_TXT)) |
8650c629 ÆAB |
472 | $(LINT_DOCS_MAN_SECTION_ORDER): lint-man-section-order.perl |
473 | $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt | |
0b6d0bc9 | 474 | $(call mkdir_p_parent_template) |
8650c629 ÆAB |
475 | $(QUIET_LINT_MANSEC)$(PERL_PATH) lint-man-section-order.perl $< >$@ |
476 | .PHONY: lint-docs-man-section-order | |
477 | lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER) | |
478 | ||
479 | ## Lint: list of targets above | |
480 | .PHONY: lint-docs | |
481 | lint-docs: lint-docs-gitlink | |
482 | lint-docs: lint-docs-man-end-blurb | |
483 | lint-docs: lint-docs-man-section-order | |
ab81411c | 484 | |
3d5b568f JNA |
485 | ifeq ($(wildcard po/Makefile),po/Makefile) |
486 | doc-l10n install-l10n:: | |
487 | $(MAKE) -C po $@ | |
488 | endif | |
489 | ||
13fca9f3 | 490 | .PHONY: FORCE |