2 $(filter-out $(addsuffix .txt
, $(ARTICLES
) $(SP_ARTICLES
)), \
3 $(wildcard git-
*.txt
)) \
5 MAN5_TXT
=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
6 gitrepository-layout.txt
7 MAN7_TXT
=gitcli.txt gittutorial.txt gittutorial-2.txt \
8 gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt \
9 gitdiffcore.txt gitworkflows.txt
11 MAN_TXT
= $(MAN1_TXT
) $(MAN5_TXT
) $(MAN7_TXT
)
12 MAN_XML
=$(patsubst %.txt
,%.xml
,$(MAN_TXT
))
13 MAN_HTML
=$(patsubst %.txt
,%.html
,$(MAN_TXT
))
17 ARTICLES
= howto-index
20 ARTICLES
+= git-bisect-lk2009
21 # with their own formatting rules.
22 SP_ARTICLES
= howto
/revert-branch-rebase howto
/using-merge-subtree user-manual
23 API_DOCS
= $(patsubst %.txt
,%,$(filter-out technical
/api-index-skel.txt technical
/api-index.txt
, $(wildcard technical
/api-
*.txt
)))
24 SP_ARTICLES
+= $(API_DOCS
)
25 SP_ARTICLES
+= technical
/api-index
27 DOC_HTML
+= $(patsubst %,%.html
,$(ARTICLES
) $(SP_ARTICLES
))
29 DOC_MAN1
=$(patsubst %.txt
,%.1,$(MAN1_TXT
))
30 DOC_MAN5
=$(patsubst %.txt
,%.5,$(MAN5_TXT
))
31 DOC_MAN7
=$(patsubst %.txt
,%.7,$(MAN7_TXT
))
35 htmldir?
=$(prefix)/share
/doc
/git-doc
36 pdfdir?
=$(prefix)/share
/doc
/git-doc
37 mandir?
=$(prefix)/share
/man
38 man1dir=$(mandir)/man1
39 man5dir=$(mandir)/man5
40 man7dir=$(mandir)/man7
45 MANPAGE_XSL
= manpage-normal.xsl
50 HTML_REF
= origin/html
52 infodir?
=$(prefix)/share
/info
54 INSTALL_INFO
=install-info
55 DOCBOOK2X_TEXI
=docbook2x-texi
58 PERL_PATH
= /usr
/bin
/perl
61 -include ..
/config.mak.autogen
62 -include ..
/config.mak
66 # -7.1.2, no extra settings are needed.
67 # 8.0-, set ASCIIDOC8.
72 # -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0)
73 # 1.69.0, no extra settings are needed?
74 # 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP?
75 # 1.71.1, no extra settings are needed?
76 # 1.72.0, set DOCBOOK_XSL_172.
77 # 1.73.0-, set ASCIIDOC_NO_ROFF
81 # If you had been using DOCBOOK_XSL_172 in an attempt to get rid
82 # of 'the ".ft C" problem' in your generated manpages, and you
83 # instead ended up with weird characters around callouts, try
84 # using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8).
88 ASCIIDOC_EXTRA
+= -a asciidoc7compatible
-a no-inline-literal
91 ASCIIDOC_EXTRA
+= -a git-asciidoc-no-roff
92 MANPAGE_XSL
= manpage-1.72.xsl
94 ifdef ASCIIDOC_NO_ROFF
95 # docbook-xsl after 1.72 needs the regular XSL, but will not
96 # pass-thru raw roff codes from asciidoc.conf, so turn them off.
97 ASCIIDOC_EXTRA
+= -a git-asciidoc-no-roff
100 ifdef MAN_BOLD_LITERAL
101 XMLTO_EXTRA
+= -m manpage-bold-literal.xsl
103 ifdef DOCBOOK_SUPPRESS_SP
104 XMLTO_EXTRA
+= -m manpage-suppress-sp.xsl
107 # Newer DocBook stylesheet emits warning cruft in the output when
108 # this is not set, and if set it shows an absolute link. We can
109 # use MAN_BASE_URL=http://www.kernel.org/pub/software/scm/git/docs/
110 # but distros may want to set it to /usr/share/doc/git-core/docs/ or
111 # something like that.
113 # As older stylesheets simply ignore this parameter, it ought to be
114 # safe to set it to empty string when the base URL is not specified,
115 # but unfortunately we cannot do so unconditionally because at least
116 # xmlto 0.0.18 is reported to lack --stringparam option.
118 XMLTO_EXTRA
+= --stringparam man.base.url.for.relative.links
=$(MAN_BASE_URL
)
121 # If your target system uses GNU groff, it may try to render
122 # apostrophes as a "pretty" apostrophe using unicode. This breaks
123 # cut&paste, so you should set GNU_ROFF to force them to be ASCII
124 # apostrophes. Unfortunately does not work with non-GNU roff.
126 XMLTO_EXTRA
+= -m manpage-quote-apos.xsl
129 SHELL_PATH ?
= $(SHELL
)
131 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
134 # Please note that there is a minor bug in asciidoc.
135 # The version after 6.0.3 _will_ include the patch found here:
136 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
138 # Until that version is released you may have to apply the patch
139 # yourself - yes, all 6 characters of it!
142 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
145 ifneq ($(findstring $(MAKEFLAGS),w),w)
146 PRINT_DIR = --no-print-directory
151 ifneq ($(findstring $(MAKEFLAGS),s),s)
153 QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
154 QUIET_XMLTO = @echo ' ' XMLTO $@;
155 QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
156 QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
157 QUIET_DBLATEX = @echo ' ' DBLATEX $@;
158 QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
159 QUIET_GEN = @echo ' ' GEN $@;
160 QUIET_STDERR = 2> /dev/null
161 QUIET_SUBDIR0 = +@subdir=
162 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
163 $(MAKE) $(PRINT_DIR) -C $$subdir
172 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
179 info: git.info gitman.info
186 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
187 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
188 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
189 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
190 $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
191 $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
194 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
195 $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
196 if test -r $(DESTDIR)$(infodir)/dir; then \
197 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
198 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
200 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
204 $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
205 $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir)
208 '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
210 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
211 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
213 -include ../GIT-VERSION-FILE
216 # Determine "include::" file references in asciidoc files.
218 doc.dep : $(wildcard *.txt) build-docdep.perl
219 $(QUIET_GEN)$(RM) $@+ $@ && \
220 $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
225 cmds_txt = cmds-ancillaryinterrogators.txt \
226 cmds-ancillarymanipulators.txt \
227 cmds-mainporcelain.txt \
228 cmds-plumbinginterrogators.txt \
229 cmds-plumbingmanipulators.txt \
230 cmds-synchingrepositories.txt \
231 cmds-synchelpers.txt \
232 cmds-purehelpers.txt \
233 cmds-foreignscminterface.txt
235 $(cmds_txt): cmd-list.made
237 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
238 $(QUIET_GEN)$(RM) $@ && \
239 $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
243 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
244 $(RM) *.texi *.texi+ *.texi++ git.info gitman.info
245 $(RM) howto-index.txt howto/*.html doc.dep
246 $(RM) technical/api-*.html technical/api-index.txt
247 $(RM) $(cmds_txt) *.made
249 $(MAN_HTML): %.html : %.txt
250 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
251 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
252 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
256 $(QUIET_XMLTO)$(RM) $@ && \
257 xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
260 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
261 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
262 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
265 user-manual.xml: user-manual.txt user-manual.conf
266 $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book $<
268 technical/api-index.txt: technical/api-index-skel.txt \
269 technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
270 $(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ
)' ./api-index.sh
272 $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
273 $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
274 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
277 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
279 user-manual.html: user-manual.xml
280 $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
282 git.info: user-manual.texi
283 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
285 user-manual.texi: user-manual.xml
286 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
287 $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
288 $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
292 user-manual.pdf: user-manual.xml
293 $(QUIET_DBLATEX)$(RM) $@+ $@ && \
294 $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
297 gitman.texi: $(MAN_XML) cat-texi.perl
298 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
299 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
300 --to-stdout $(xml) &&) true) > $@++ && \
301 $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
305 gitman.info: gitman.texi
306 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
308 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
309 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
310 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
313 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
314 $(QUIET_GEN)$(RM) $@+ $@ && \
315 '$(SHELL_PATH_SQ
)' ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
318 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
319 $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 $*.txt
321 WEBDOC_DEST = /pub/software/scm/git/docs
323 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
324 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
325 sed -e '1,/^
$$/d
' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \
328 install-webdoc : html
329 '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(WEBDOC_DEST)
331 quick-install: quick-install-man
334 '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
337 '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
339 .PHONY: .FORCE-GIT-VERSION-FILE