Taiga 1274 (24976) Updated guided reports process
[kohadocs.git] / Makefile
1 # Makefile for Sphinx documentation
2 #
3
4 # You can set these variables from the command line.
5 SPHINXOPTS    =
6 SPHINXBUILD   = sphinx-build
7 PAPER         =
8 BUILDDIR      = build
9 SHELL         := /bin/bash
10
11 # Internal variables.
12 PAPEROPT_a4     = -D latex_paper_size=a4
13 PAPEROPT_letter = -D latex_paper_size=letter
14 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
15 # the i18n builder cannot share the environment and doctrees with the others
16 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
17
18 .PHONY: help
19 help:
20         @echo "Please use \`make <target>' where <target> is one of"
21         @echo "  html       to make standalone HTML files"
22         @echo "  dirhtml    to make HTML files named index.html in directories"
23         @echo "  singlehtml to make a single large HTML file"
24         @echo "  pickle     to make pickle files"
25         @echo "  json       to make JSON files"
26         @echo "  htmlhelp   to make HTML files and a HTML help project"
27         @echo "  qthelp     to make HTML files and a qthelp project"
28         @echo "  applehelp  to make an Apple Help Book"
29         @echo "  devhelp    to make HTML files and a Devhelp project"
30         @echo "  epub       to make an epub"
31         @echo "  epub3      to make an epub3"
32         @echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
33         @echo "  latexpdf   to make LaTeX files and run them through pdflatex"
34         @echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
35         @echo "  text       to make text files"
36         @echo "  man        to make manual pages"
37         @echo "  texinfo    to make Texinfo files"
38         @echo "  info       to make Texinfo files and run them through makeinfo"
39         @echo "  gettext    to make PO message catalogs"
40         @echo "  changes    to make an overview of all changed/added/deprecated items"
41         @echo "  xml        to make Docutils-native XML files"
42         @echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
43         @echo "  linkcheck  to check all external links for integrity"
44         @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
45         @echo "  coverage   to run coverage check of the documentation (if enabled)"
46         @echo "  dummy      to check syntax errors of document sources"
47         @echo "  spelling   to check spelling errors of document sources"
48
49 .PHONY: clean
50 clean:
51         rm -rf $(BUILDDIR)/*
52
53 .PHONY: html
54 html:
55         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
56         @echo
57         @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
58
59 .PHONY: all_html
60 all_html:
61         for l in $$(echo "en `ls locales`");                                   \
62         do                                                                     \
63                 make -e SPHINXOPTS="-D language='$$l' -d build/doctrees" BUILDDIR="build/$$l" html ; \
64         done;
65         @echo "Build finished. The HTML pages are in $(BUILDDIR)/LANG/html."
66
67 .PHONY: all_epub
68 all_epub:
69         for l in $$(echo "en `ls locales`");                                   \
70         do                                                                     \
71                 make -e SPHINXOPTS="-D language='$$l' -d build/doctrees" BUILDDIR="build/$$l" epub ; \
72         done;
73         @echo "Build finished. The epub files are in $(BUILDDIR)/LANG/epub."
74
75 .PHONY: dirhtml
76 dirhtml:
77         $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
78         @echo
79         @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
80
81 .PHONY: singlehtml
82 singlehtml:
83         $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
84         @echo
85         @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
86
87 .PHONY: pickle
88 pickle:
89         $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
90         @echo
91         @echo "Build finished; now you can process the pickle files."
92
93 .PHONY: json
94 json:
95         $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
96         @echo
97         @echo "Build finished; now you can process the JSON files."
98
99 .PHONY: htmlhelp
100 htmlhelp:
101         $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
102         @echo
103         @echo "Build finished; now you can run HTML Help Workshop with the" \
104               ".hhp project file in $(BUILDDIR)/htmlhelp."
105
106 .PHONY: qthelp
107 qthelp:
108         $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
109         @echo
110         @echo "Build finished; now you can run "qcollectiongenerator" with the" \
111               ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
112         @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/KohaManual.qhcp"
113         @echo "To view the help file:"
114         @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/KohaManual.qhc"
115
116 .PHONY: applehelp
117 applehelp:
118         $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
119         @echo
120         @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
121         @echo "N.B. You won't be able to view it unless you put it in" \
122               "~/Library/Documentation/Help or install it in your application" \
123               "bundle."
124
125 .PHONY: devhelp
126 devhelp:
127         $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
128         @echo
129         @echo "Build finished."
130         @echo "To view the help file:"
131         @echo "# mkdir -p $$HOME/.local/share/devhelp/KohaManual"
132         @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/KohaManual"
133         @echo "# devhelp"
134
135 .PHONY: epub
136 epub:
137         $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
138         @echo
139         @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
140
141 .PHONY: epub3
142 epub3:
143         $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
144         @echo
145         @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
146
147 .PHONY: latex
148 latex:
149         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
150         @echo
151         @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
152         @echo "Run \`make' in that directory to run these through (pdf)latex" \
153               "(use \`make latexpdf' here to do that automatically)."
154
155 .PHONY: latexpdf
156 latexpdf:
157         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
158         @echo "Running LaTeX files through pdflatex..."
159         $(MAKE) -C $(BUILDDIR)/latex all-pdf
160         @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
161
162 .PHONY: latexpdfja
163 latexpdfja:
164         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
165         @echo "Running LaTeX files through platex and dvipdfmx..."
166         $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
167         @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
168
169 .PHONY: text
170 text:
171         $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
172         @echo
173         @echo "Build finished. The text files are in $(BUILDDIR)/text."
174
175 .PHONY: man
176 man:
177         $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
178         @echo
179         @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
180
181 .PHONY: texinfo
182 texinfo:
183         $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
184         @echo
185         @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
186         @echo "Run \`make' in that directory to run these through makeinfo" \
187               "(use \`make info' here to do that automatically)."
188
189 .PHONY: info
190 info:
191         $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
192         @echo "Running Texinfo files through makeinfo..."
193         make -C $(BUILDDIR)/texinfo info
194         @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
195
196 .PHONY: gettext
197 gettext:
198         $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
199         @echo
200         @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
201
202 .PHONY: changes
203 changes:
204         $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
205         @echo
206         @echo "The overview file is in $(BUILDDIR)/changes."
207
208 .PHONY: linkcheck
209 linkcheck:
210         $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
211         @echo
212         @echo "Link check complete; look for any errors in the above output " \
213               "or in $(BUILDDIR)/linkcheck/output.txt."
214
215 .PHONY: doctest
216 doctest:
217         $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
218         @echo "Testing of doctests in the sources finished, look at the " \
219               "results in $(BUILDDIR)/doctest/output.txt."
220
221 .PHONY: coverage
222 coverage:
223         $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
224         @echo "Testing of coverage in the sources finished, look at the " \
225               "results in $(BUILDDIR)/coverage/python.txt."
226
227 .PHONY: xml
228 xml:
229         $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
230         @echo
231         @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
232
233 .PHONY: pseudoxml
234 pseudoxml:
235         $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
236         @echo
237         @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
238
239 .PHONY: dummy
240 dummy:
241         $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
242         @echo
243         @echo "Build finished. Dummy builder generates no files."
244
245 .PHONY: spelling
246 spelling:
247         $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
248         @echo
249         @echo "Spell check complete; look for any errors in $(BUILDDIR)/spelling/output.txt."