llvm-project
190 строк · 5.0 Кб
1@ECHO OFF
2
3REM Command file for Sphinx documentation
4
5if "%SPHINXBUILD%" == "" (
6set SPHINXBUILD=sphinx-build
7)
8set BUILDDIR=_build
9set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10set I18NSPHINXOPTS=%SPHINXOPTS% .
11if NOT "%PAPER%" == "" (
12set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14)
15
16if "%1" == "" goto help
17
18if "%1" == "help" (
19:help
20echo.Please use `make ^<target^>` where ^<target^> is one of
21echo. html to make standalone HTML files
22echo. dirhtml to make HTML files named index.html in directories
23echo. singlehtml to make a single large HTML file
24echo. pickle to make pickle files
25echo. json to make JSON files
26echo. htmlhelp to make HTML files and a HTML help project
27echo. qthelp to make HTML files and a qthelp project
28echo. devhelp to make HTML files and a Devhelp project
29echo. epub to make an epub
30echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31echo. text to make text files
32echo. man to make manual pages
33echo. texinfo to make Texinfo files
34echo. gettext to make PO message catalogs
35echo. changes to make an overview over all changed/added/deprecated items
36echo. linkcheck to check all external links for integrity
37echo. doctest to run all doctests embedded in the documentation if enabled
38goto end
39)
40
41if "%1" == "clean" (
42for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
43del /q /s %BUILDDIR%\*
44goto end
45)
46
47if "%1" == "html" (
48%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
49if errorlevel 1 exit /b 1
50echo.
51echo.Build finished. The HTML pages are in %BUILDDIR%/html.
52goto end
53)
54
55if "%1" == "dirhtml" (
56%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
57if errorlevel 1 exit /b 1
58echo.
59echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
60goto end
61)
62
63if "%1" == "singlehtml" (
64%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
65if errorlevel 1 exit /b 1
66echo.
67echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
68goto end
69)
70
71if "%1" == "pickle" (
72%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
73if errorlevel 1 exit /b 1
74echo.
75echo.Build finished; now you can process the pickle files.
76goto end
77)
78
79if "%1" == "json" (
80%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
81if errorlevel 1 exit /b 1
82echo.
83echo.Build finished; now you can process the JSON files.
84goto end
85)
86
87if "%1" == "htmlhelp" (
88%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
89if errorlevel 1 exit /b 1
90echo.
91echo.Build finished; now you can run HTML Help Workshop with the ^
92.hhp project file in %BUILDDIR%/htmlhelp.
93goto end
94)
95
96if "%1" == "qthelp" (
97%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
98if errorlevel 1 exit /b 1
99echo.
100echo.Build finished; now you can run "qcollectiongenerator" with the ^
101.qhcp project file in %BUILDDIR%/qthelp, like this:
102echo.^> qcollectiongenerator %BUILDDIR%\qthelp\lld.qhcp
103echo.To view the help file:
104echo.^> assistant -collectionFile %BUILDDIR%\qthelp\lld.ghc
105goto end
106)
107
108if "%1" == "devhelp" (
109%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
110if errorlevel 1 exit /b 1
111echo.
112echo.Build finished.
113goto end
114)
115
116if "%1" == "epub" (
117%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
118if errorlevel 1 exit /b 1
119echo.
120echo.Build finished. The epub file is in %BUILDDIR%/epub.
121goto end
122)
123
124if "%1" == "latex" (
125%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
126if errorlevel 1 exit /b 1
127echo.
128echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
129goto end
130)
131
132if "%1" == "text" (
133%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
134if errorlevel 1 exit /b 1
135echo.
136echo.Build finished. The text files are in %BUILDDIR%/text.
137goto end
138)
139
140if "%1" == "man" (
141%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
142if errorlevel 1 exit /b 1
143echo.
144echo.Build finished. The manual pages are in %BUILDDIR%/man.
145goto end
146)
147
148if "%1" == "texinfo" (
149%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
150if errorlevel 1 exit /b 1
151echo.
152echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
153goto end
154)
155
156if "%1" == "gettext" (
157%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
158if errorlevel 1 exit /b 1
159echo.
160echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
161goto end
162)
163
164if "%1" == "changes" (
165%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
166if errorlevel 1 exit /b 1
167echo.
168echo.The overview file is in %BUILDDIR%/changes.
169goto end
170)
171
172if "%1" == "linkcheck" (
173%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
174if errorlevel 1 exit /b 1
175echo.
176echo.Link check complete; look for any errors in the above output ^
177or in %BUILDDIR%/linkcheck/output.txt.
178goto end
179)
180
181if "%1" == "doctest" (
182%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
183if errorlevel 1 exit /b 1
184echo.
185echo.Testing of doctests in the sources finished, look at the ^
186results in %BUILDDIR%/doctest/output.txt.
187goto end
188)
189
190:end
191