2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
5 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
8 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
11 ARTICLES += tutorial-2
12 ARTICLES += core-tutorial
13 ARTICLES += cvs-migration
15 ARTICLES += howto-index
16 ARTICLES += repository-layout
21 # with their own formatting rules.
22 SP_ARTICLES = howto/revert-branch-rebase user-manual
24 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
26 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
27 DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
28 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
32 htmldir?=$(prefix)/share/doc/git-doc
33 mandir?=$(prefix)/share/man
34 man1dir=$(mandir)/man1
35 man5dir=$(mandir)/man5
36 man7dir=$(mandir)/man7
45 infodir?=$(prefix)/share/info
47 INSTALL_INFO=install-info
48 DOCBOOK2X_TEXI=docbook2x-texi
50 PERL_PATH = /usr/bin/perl
53 -include ../config.mak.autogen
54 -include ../config.mak
57 ASCIIDOC_EXTRA += -a asciidoc7compatible
60 ASCIIDOC_EXTRA += -a docbook-xsl-172
64 # Please note that there is a minor bug in asciidoc.
65 # The version after 6.0.3 _will_ include the patch found here:
66 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
68 # Until that version is released you may have to apply the patch
69 # yourself - yes, all 6 characters of it!
76 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
86 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
87 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
88 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
89 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
90 $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
91 $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
94 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
95 $(INSTALL) -m 644 git.info $(DESTDIR)$(infodir)
96 if test -r $(DESTDIR)$(infodir)/dir; then \
97 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
99 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
103 sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
105 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
106 $(MAKE) -C ../ GIT-VERSION-FILE
108 -include ../GIT-VERSION-FILE
111 # Determine "include::" file references in asciidoc files.
113 doc.dep : $(wildcard *.txt) build-docdep.perl
115 $(PERL_PATH) ./build-docdep.perl >$@+
120 cmds_txt = cmds-ancillaryinterrogators.txt \
121 cmds-ancillarymanipulators.txt \
122 cmds-mainporcelain.txt \
123 cmds-plumbinginterrogators.txt \
124 cmds-plumbingmanipulators.txt \
125 cmds-synchingrepositories.txt \
126 cmds-synchelpers.txt \
127 cmds-purehelpers.txt \
128 cmds-foreignscminterface.txt
130 $(cmds_txt): cmd-list.made
132 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
134 $(PERL_PATH) ./cmd-list.perl ../command-list.txt
137 git.7 git.html: git.txt
140 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
141 $(RM) $(cmds_txt) *.made
145 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
146 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
151 xmlto -m callouts.xsl man $<
155 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
156 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
159 user-manual.xml: user-manual.txt user-manual.conf
160 $(ASCIIDOC) -b docbook -d book $<
163 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
165 user-manual.html: user-manual.xml
166 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
168 git.info: user-manual.xml
169 $(RM) $@ $*.texi $*.texi+
170 $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
171 $(PERL_PATH) fix-texi.perl <$*.texi+ >$*.texi
172 $(MAKEINFO) --no-split $*.texi
173 $(RM) $*.texi $*.texi+
175 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
177 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
180 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
181 $(ASCIIDOC) -b xhtml11 $*.txt
183 WEBDOC_DEST = /pub/software/scm/git/docs
185 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
187 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
190 install-webdoc : html
191 sh ./install-webdoc.sh $(WEBDOC_DEST)
194 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
196 .PHONY: .FORCE-GIT-VERSION-FILE