2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
5 MAN5_TXT=gitattributes.txt gitignore.txt gitcli.txt gitmodules.txt
8 MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
9 MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
10 MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
15 ARTICLES += tutorial-2
16 ARTICLES += core-tutorial
17 ARTICLES += cvs-migration
19 ARTICLES += howto-index
20 ARTICLES += repository-layout
25 # with their own formatting rules.
26 SP_ARTICLES = howto/revert-branch-rebase howto/using-merge-subtree user-manual
27 API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
28 SP_ARTICLES += $(API_DOCS)
29 SP_ARTICLES += technical/api-index
31 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
33 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
34 DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
35 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
39 htmldir?=$(prefix)/share/doc/git-doc
40 mandir?=$(prefix)/share/man
41 man1dir=$(mandir)/man1
42 man5dir=$(mandir)/man5
43 man7dir=$(mandir)/man7
52 infodir?=$(prefix)/share/info
54 INSTALL_INFO=install-info
55 DOCBOOK2X_TEXI=docbook2x-texi
57 PERL_PATH = /usr/bin/perl
60 -include ../config.mak.autogen
61 -include ../config.mak
64 ASCIIDOC_EXTRA += -a asciidoc7compatible
67 ASCIIDOC_EXTRA += -a docbook-xsl-172
71 # Please note that there is a minor bug in asciidoc.
72 # The version after 6.0.3 _will_ include the patch found here:
73 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
75 # Until that version is released you may have to apply the patch
76 # yourself - yes, all 6 characters of it!
83 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
90 info: git.info gitman.info
93 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
94 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
95 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
96 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
97 $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
98 $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
101 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
102 $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
103 if test -r $(DESTDIR)$(infodir)/dir; then \
104 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
105 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
107 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
111 sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
113 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
114 $(MAKE) -C ../ GIT-VERSION-FILE
116 -include ../GIT-VERSION-FILE
119 # Determine "include::" file references in asciidoc files.
121 doc.dep : $(wildcard *.txt) build-docdep.perl
123 $(PERL_PATH) ./build-docdep.perl >$@+
128 cmds_txt = cmds-ancillaryinterrogators.txt \
129 cmds-ancillarymanipulators.txt \
130 cmds-mainporcelain.txt \
131 cmds-plumbinginterrogators.txt \
132 cmds-plumbingmanipulators.txt \
133 cmds-synchingrepositories.txt \
134 cmds-synchelpers.txt \
135 cmds-purehelpers.txt \
136 cmds-foreignscminterface.txt
138 $(cmds_txt): cmd-list.made
140 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
142 $(PERL_PATH) ./cmd-list.perl ../command-list.txt
145 git.7 git.html: git.txt
148 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
149 $(RM) *.texi *.texi+ git.info gitman.info
150 $(RM) howto-index.txt howto/*.html doc.dep
151 $(RM) technical/api-*.html technical/api-index.txt
152 $(RM) $(cmds_txt) *.made
154 $(MAN_HTML): %.html : %.txt
156 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
157 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
162 xmlto -m callouts.xsl man $<
166 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
167 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
170 user-manual.xml: user-manual.txt user-manual.conf
171 $(ASCIIDOC) -b docbook -d book $<
173 technical/api-index.txt: technical/api-index-skel.txt \
174 technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
175 cd technical && sh ./api-index.sh
177 $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
178 $(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
179 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt
182 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
184 user-manual.html: user-manual.xml
185 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
187 git.info: user-manual.texi
188 $(MAKEINFO) --no-split -o $@ user-manual.texi
190 user-manual.texi: user-manual.xml
192 $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
195 gitman.texi: $(MAN_XML) cat-texi.perl
197 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \
198 $(PERL_PATH) cat-texi.perl $@ >$@+
201 gitman.info: gitman.texi
202 $(MAKEINFO) --no-split $*.texi
204 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
206 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+
209 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
211 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
214 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
215 $(ASCIIDOC) -b xhtml11 $*.txt
217 WEBDOC_DEST = /pub/software/scm/git/docs
219 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
221 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
224 install-webdoc : html
225 sh ./install-webdoc.sh $(WEBDOC_DEST)
228 sh ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
230 .PHONY: .FORCE-GIT-VERSION-FILE