Debian Codegraph @

docs/src/Makefile

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