Code

Merge branch 'js/export-with-assignment'
[git.git] / Documentation / Makefile
1 MAN1_TXT= \
2         $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3                 $(wildcard git-*.txt)) \
4         gitk.txt
5 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
6 MAN7_TXT=git.txt
8 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
10 ARTICLES = tutorial
11 ARTICLES += tutorial-2
12 ARTICLES += core-tutorial
13 ARTICLES += cvs-migration
14 ARTICLES += diffcore
15 ARTICLES += howto-index
16 ARTICLES += repository-layout
17 ARTICLES += hooks
18 ARTICLES += everyday
19 ARTICLES += git-tools
20 ARTICLES += glossary
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))
30 prefix?=$(HOME)
31 bindir?=$(prefix)/bin
32 mandir?=$(prefix)/share/man
33 man1dir=$(mandir)/man1
34 man5dir=$(mandir)/man5
35 man7dir=$(mandir)/man7
36 # DESTDIR=
38 ASCIIDOC=asciidoc
39 ASCIIDOC_EXTRA =
40 INSTALL?=install
41 RM ?= rm -f
42 DOC_REF = origin/man
44 infodir?=$(prefix)/share/info
45 MAKEINFO=makeinfo
46 INSTALL_INFO=install-info
47 DOCBOOK2X_TEXI=docbook2x-texi
49 -include ../config.mak.autogen
50 -include ../config.mak
52 ifdef ASCIIDOC8
53 ASCIIDOC_EXTRA += -a asciidoc7compatible
54 endif
55 ifdef DOCBOOK_XSL_172
56 ASCIIDOC_EXTRA += -a docbook-xsl-172
57 endif
59 #
60 # Please note that there is a minor bug in asciidoc.
61 # The version after 6.0.3 _will_ include the patch found here:
62 #   http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
63 #
64 # Until that version is released you may have to apply the patch
65 # yourself - yes, all 6 characters of it!
66 #
68 all: html man
70 html: $(DOC_HTML)
72 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
74 man: man1 man5 man7
75 man1: $(DOC_MAN1)
76 man5: $(DOC_MAN5)
77 man7: $(DOC_MAN7)
79 info: git.info
81 install: man
82         $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
83         $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
84         $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
85         $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
86         $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
87         $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
89 install-info: info
90         $(INSTALL) -d -m755 $(DESTDIR)$(infodir)
91         $(INSTALL) -m644 git.info $(DESTDIR)$(infodir)
92         if test -r $(DESTDIR)$(infodir)/dir; then \
93           $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
94         else \
95           echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
96         fi
98 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
99         $(MAKE) -C ../ GIT-VERSION-FILE
101 -include ../GIT-VERSION-FILE
104 # Determine "include::" file references in asciidoc files.
106 doc.dep : $(wildcard *.txt) build-docdep.perl
107         $(RM) $@+ $@
108         perl ./build-docdep.perl >$@+
109         mv $@+ $@
111 -include doc.dep
113 cmds_txt = cmds-ancillaryinterrogators.txt \
114         cmds-ancillarymanipulators.txt \
115         cmds-mainporcelain.txt \
116         cmds-plumbinginterrogators.txt \
117         cmds-plumbingmanipulators.txt \
118         cmds-synchingrepositories.txt \
119         cmds-synchelpers.txt \
120         cmds-purehelpers.txt \
121         cmds-foreignscminterface.txt
123 $(cmds_txt): cmd-list.made
125 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
126         $(RM) $@
127         perl ./cmd-list.perl ../command-list.txt
128         date >$@
130 git.7 git.html: git.txt
132 clean:
133         $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
134         $(RM) $(cmds_txt) *.made
136 %.html : %.txt
137         $(RM) $@+ $@
138         $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
139                 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
140         mv $@+ $@
142 %.1 %.5 %.7 : %.xml
143         $(RM) $@
144         xmlto -m callouts.xsl man $<
146 %.xml : %.txt
147         $(RM) $@+ $@
148         $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
149                 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
150         mv $@+ $@
152 user-manual.xml: user-manual.txt user-manual.conf
153         $(ASCIIDOC) -b docbook -d book $<
155 XSLT = docbook.xsl
156 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
158 user-manual.html: user-manual.xml
159         xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
161 git.info: user-manual.xml
162         $(RM) $@ $*.texi $*.texi+
163         $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
164         perl fix-texi.perl <$*.texi+ >$*.texi
165         $(MAKEINFO) --no-split $*.texi
166         $(RM) $*.texi $*.texi+
168 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
169         $(RM) $@+ $@
170         sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
171         mv $@+ $@
173 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
174         $(ASCIIDOC) -b xhtml11 $*.txt
176 WEBDOC_DEST = /pub/software/scm/git/docs
178 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
179         $(RM) $@+ $@
180         sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
181         mv $@+ $@
183 install-webdoc : html
184         sh ./install-webdoc.sh $(WEBDOC_DEST)
186 quick-install:
187         sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
189 .PHONY: .FORCE-GIT-VERSION-FILE