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