Debian Codegraph @

doc/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 PYTHON = python
8 PAPER =
9 BUILDDIR = _build
10 PORT = 8000
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 clean viewer-assets html serve dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
25
26 help:
27 @echo "Please use \`make <target>' where <target> is one of"
28 @echo " html to make standalone HTML files"
29 @echo " serve to build and serve HTML at http://localhost:$(PORT)"
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 " devhelp to make HTML files and a Devhelp project"
37 @echo " epub to make an epub"
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
52 clean:
53 rm -rf $(BUILDDIR)/*
54 rm -rf _static/viewer
55
56 viewer-assets:
57 @if command -v npm >/dev/null 2>&1 && test -d node_modules; then \
58 npm run build; \
59 elif test "$(STRICT_VIEWER)" = "1"; then \
60 echo "npm and doc/node_modules are required when STRICT_VIEWER=1"; exit 1; \
61 else \
62 echo "WARNING: skipping 3D viewer build (npm or doc/node_modules not found)"; \
63 fi
64
65 html: viewer-assets
66 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
67 @echo
68 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
69
70 serve: html
71 $(PYTHON) -m http.server $(PORT) --directory $(BUILDDIR)/html
72
73 dirhtml: viewer-assets
74 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
75 @echo
76 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
77
78 singlehtml: viewer-assets
79 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
80 @echo
81 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
82
83 pickle:
84 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
85 @echo
86 @echo "Build finished; now you can process the pickle files."
87
88 json:
89 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
90 @echo
91 @echo "Build finished; now you can process the JSON files."
92
93 htmlhelp:
94 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
95 @echo
96 @echo "Build finished; now you can run HTML Help Workshop with the" \
97 ".hhp project file in $(BUILDDIR)/htmlhelp."
98
99 qthelp:
100 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
101 @echo
102 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
103 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
104 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/COLMAP.qhcp"
105 @echo "To view the help file:"
106 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/COLMAP.qhc"
107
108 devhelp:
109 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
110 @echo
111 @echo "Build finished."
112 @echo "To view the help file:"
113 @echo "# mkdir -p $$HOME/.local/share/devhelp/COLMAP"
114 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/COLMAP"
115 @echo "# devhelp"
116
117 epub:
118 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
119 @echo
120 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
121
122 latex:
123 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
124 @echo
125 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
126 @echo "Run \`make' in that directory to run these through (pdf)latex" \
127 "(use \`make latexpdf' here to do that automatically)."
128
129 latexpdf:
130 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
131 @echo "Running LaTeX files through pdflatex..."
132 $(MAKE) -C $(BUILDDIR)/latex all-pdf
133 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
134
135 latexpdfja:
136 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
137 @echo "Running LaTeX files through platex and dvipdfmx..."
138 $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
139 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
140
141 text:
142 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
143 @echo
144 @echo "Build finished. The text files are in $(BUILDDIR)/text."
145
146 man:
147 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
148 @echo
149 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
150
151 texinfo:
152 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
153 @echo
154 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
155 @echo "Run \`make' in that directory to run these through makeinfo" \
156 "(use \`make info' here to do that automatically)."
157
158 info:
159 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
160 @echo "Running Texinfo files through makeinfo..."
161 make -C $(BUILDDIR)/texinfo info
162 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
163
164 gettext:
165 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
166 @echo
167 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
168
169 changes:
170 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
171 @echo
172 @echo "The overview file is in $(BUILDDIR)/changes."
173
174 linkcheck:
175 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
176 @echo
177 @echo "Link check complete; look for any errors in the above output " \
178 "or in $(BUILDDIR)/linkcheck/output.txt."
179
180 doctest:
181 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
182 @echo "Testing of doctests in the sources finished, look at the " \
183 "results in $(BUILDDIR)/doctest/output.txt."
184
185 xml:
186 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
187 @echo
188 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
189
190 pseudoxml:
191 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
192 @echo
193 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."