1 # Makefile for Sphinx documentation
4 # You can set these variables from the command line.
6 SRC_DOC_DIR = $(WS_ROOT)/test/doc
7 SPHINXBUILD = sphinx-build
9 BUILD_DOC_ROOT = $(BR)/test-doc
10 BUILD_DOC_DIR = $(BUILD_DOC_ROOT)/build
13 PAPEROPT_a4 = -D latex_paper_size=a4
14 PAPEROPT_letter = -D latex_paper_size=letter
15 ALLSPHINXOPTS = -d $(BUILD_DOC_DIR)/.sphinx-cache $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRC_DOC_DIR)
16 # the i18n builder cannot share the environment and doctrees with the others
17 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
18 IN_VENV:=$(shell if pip -V | grep "virtualenv" 2>&1 > /dev/null; then echo 1; else echo 0; fi)
20 .PHONY: verify-virtualenv
23 $(error "Not running inside virtualenv (are you running 'make test-doc' from root?)")
28 @echo "Please use \`make <target>' where <target> is one of"
29 @echo " html to make standalone HTML files"
30 @echo " dirhtml to make HTML files named index.html in directories"
31 @echo " singlehtml to make a single large HTML file"
32 @echo " pickle to make pickle files"
33 @echo " json to make JSON files"
34 @echo " htmlhelp to make HTML files and a HTML help project"
35 @echo " qthelp to make HTML files and a qthelp project"
36 @echo " applehelp to make an Apple Help Book"
37 @echo " devhelp to make HTML files and a Devhelp project"
38 @echo " epub to make an epub"
39 @echo " epub3 to make an epub3"
40 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
41 @echo " latexpdf to make LaTeX files and run them through pdflatex"
42 @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
43 @echo " text to make text files"
44 @echo " man to make manual pages"
45 @echo " texinfo to make Texinfo files"
46 @echo " info to make Texinfo files and run them through makeinfo"
47 @echo " gettext to make PO message catalogs"
48 @echo " changes to make an overview of all changed/added/deprecated items"
49 @echo " xml to make Docutils-native XML files"
50 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
51 @echo " linkcheck to check all external links for integrity"
52 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
53 @echo " coverage to run coverage check of the documentation (if enabled)"
54 @echo " dummy to check syntax errors of document sources"
58 rm -rf $(BUILD_DOC_ROOT)
61 html: verify-virtualenv
62 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/html
64 @echo "Build finished. The HTML pages are in $(BUILD_DOC_DIR)/html."
67 dirhtml: verify-virtualenv
68 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/dirhtml
70 @echo "Build finished. The HTML pages are in $(BUILD_DOC_DIR)/dirhtml."
73 singlehtml: verify-virtualenv
74 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/singlehtml
76 @echo "Build finished. The HTML page is in $(BUILD_DOC_DIR)/singlehtml."
79 pickle: verify-virtualenv
80 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/pickle
82 @echo "Build finished; now you can process the pickle files."
85 json: verify-virtualenv
86 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/json
88 @echo "Build finished; now you can process the JSON files."
91 htmlhelp: verify-virtualenv
92 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/htmlhelp
94 @echo "Build finished; now you can run HTML Help Workshop with the" \
95 ".hhp project file in $(BUILD_DOC_DIR)/htmlhelp."
98 qthelp: verify-virtualenv
99 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/qthelp
101 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
102 ".qhcp project file in $(BUILD_DOC_DIR)/qthelp, like this:"
103 @echo "# qcollectiongenerator $(BUILD_DOC_DIR)/qthelp/VPPtestframework.qhcp"
104 @echo "To view the help file:"
105 @echo "# assistant -collectionFile $(BUILD_DOC_DIR)/qthelp/VPPtestframework.qhc"
108 applehelp: verify-virtualenv
109 $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/applehelp
111 @echo "Build finished. The help book is in $(BUILD_DOC_DIR)/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" \
117 devhelp: verify-virtualenv
118 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/devhelp
120 @echo "Build finished."
121 @echo "To view the help file:"
122 @echo "# mkdir -p $$HOME/.local/share/devhelp/VPPtestframework"
123 @echo "# ln -s $(BUILD_DOC_DIR)/devhelp $$HOME/.local/share/devhelp/VPPtestframework"
127 epub: verify-virtualenv
128 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/epub
130 @echo "Build finished. The epub file is in $(BUILD_DOC_DIR)/epub."
134 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/epub3
136 @echo "Build finished. The epub3 file is in $(BUILD_DOC_DIR)/epub3."
139 latex: verify-virtualenv
140 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/latex
142 @echo "Build finished; the LaTeX files are in $(BUILD_DOC_DIR)/latex."
143 @echo "Run \`make' in that directory to run these through (pdf)latex" \
144 "(use \`make latexpdf' here to do that automatically)."
147 latexpdf: verify-virtualenv
148 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/latex
149 @echo "Running LaTeX files through pdflatex..."
150 $(MAKE) -C $(BUILD_DOC_DIR)/latex all-pdf
151 @echo "pdflatex finished; the PDF files are in $(BUILD_DOC_DIR)/latex."
154 latexpdfja: verify-virtualenv
155 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/latex
156 @echo "Running LaTeX files through platex and dvipdfmx..."
157 $(MAKE) -C $(BUILD_DOC_DIR)/latex all-pdf-ja
158 @echo "pdflatex finished; the PDF files are in $(BUILD_DOC_DIR)/latex."
161 text: verify-virtualenv
162 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/text
164 @echo "Build finished. The text files are in $(BUILD_DOC_DIR)/text."
167 man: verify-virtualenv
168 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/man
170 @echo "Build finished. The manual pages are in $(BUILD_DOC_DIR)/man."
173 texinfo: verify-virtualenv
174 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/texinfo
176 @echo "Build finished. The Texinfo files are in $(BUILD_DOC_DIR)/texinfo."
177 @echo "Run \`make' in that directory to run these through makeinfo" \
178 "(use \`make info' here to do that automatically)."
181 info: verify-virtualenv
182 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/texinfo
183 @echo "Running Texinfo files through makeinfo..."
184 make -C $(BUILD_DOC_DIR)/texinfo info
185 @echo "makeinfo finished; the Info files are in $(BUILD_DOC_DIR)/texinfo."
188 gettext: verify-virtualenv
189 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILD_DOC_DIR)/locale
191 @echo "Build finished. The message catalogs are in $(BUILD_DOC_DIR)/locale."
194 changes: verify-virtualenv
195 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/changes
197 @echo "The overview file is in $(BUILD_DOC_DIR)/changes."
200 linkcheck: verify-virtualenv
201 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/linkcheck
203 @echo "Link check complete; look for any errors in the above output " \
204 "or in $(BUILD_DOC_DIR)/linkcheck/output.txt."
207 doctest: verify-virtualenv
208 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/doctest
209 @echo "Testing of doctests in the sources finished, look at the " \
210 "results in $(BUILD_DOC_DIR)/doctest/output.txt."
213 coverage: verify-virtualenv
214 $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/coverage
215 @echo "Testing of coverage in the sources finished, look at the " \
216 "results in $(BUILD_DOC_DIR)/coverage/python.txt."
219 xml: verify-virtualenv
220 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/xml
222 @echo "Build finished. The XML files are in $(BUILD_DOC_DIR)/xml."
225 pseudoxml: verify-virtualenv
226 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/pseudoxml
228 @echo "Build finished. The pseudo-XML files are in $(BUILD_DOC_DIR)/pseudoxml."
231 dummy: verify-virtualenv
232 $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILD_DOC_DIR)/dummy
234 @echo "Build finished. Dummy builder generates no files."