libuv-svace-build
243 строки · 6.6 Кб
1@ECHO OFF
2
3REM Command file for Sphinx documentation
4
5if "%SPHINXBUILD%" == "" (
6set SPHINXBUILD=sphinx-build
7)
8set BUILDDIR=build
9set SRCDIR=src
10set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %SRCDIR%
11set I18NSPHINXOPTS=%SPHINXOPTS% %SRCDIR%
12if NOT "%PAPER%" == "" (
13set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
14set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
15)
16
17if "%1" == "" goto help
18
19if "%1" == "help" (
20:help
21echo.Please use `make ^<target^>` where ^<target^> is one of
22echo. html to make standalone HTML files
23echo. dirhtml to make HTML files named index.html in directories
24echo. singlehtml to make a single large HTML file
25echo. pickle to make pickle files
26echo. json to make JSON files
27echo. htmlhelp to make HTML files and a HTML help project
28echo. qthelp to make HTML files and a qthelp project
29echo. devhelp to make HTML files and a Devhelp project
30echo. epub to make an epub
31echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
32echo. text to make text files
33echo. man to make manual pages
34echo. texinfo to make Texinfo files
35echo. gettext to make PO message catalogs
36echo. changes to make an overview over all changed/added/deprecated items
37echo. xml to make Docutils-native XML files
38echo. pseudoxml to make pseudoxml-XML files for display purposes
39echo. linkcheck to check all external links for integrity
40echo. doctest to run all doctests embedded in the documentation if enabled
41goto end
42)
43
44if "%1" == "clean" (
45for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
46del /q /s %BUILDDIR%\*
47goto end
48)
49
50
51%SPHINXBUILD% 2> nul
52if errorlevel 9009 (
53echo.
54echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
55echo.installed, then set the SPHINXBUILD environment variable to point
56echo.to the full path of the 'sphinx-build' executable. Alternatively you
57echo.may add the Sphinx directory to PATH.
58echo.
59echo.If you don't have Sphinx installed, grab it from
60echo.http://sphinx-doc.org/
61exit /b 1
62)
63
64if "%1" == "html" (
65%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
66if errorlevel 1 exit /b 1
67echo.
68echo.Build finished. The HTML pages are in %BUILDDIR%/html.
69goto end
70)
71
72if "%1" == "dirhtml" (
73%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
74if errorlevel 1 exit /b 1
75echo.
76echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
77goto end
78)
79
80if "%1" == "singlehtml" (
81%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
82if errorlevel 1 exit /b 1
83echo.
84echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
85goto end
86)
87
88if "%1" == "pickle" (
89%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
90if errorlevel 1 exit /b 1
91echo.
92echo.Build finished; now you can process the pickle files.
93goto end
94)
95
96if "%1" == "json" (
97%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
98if errorlevel 1 exit /b 1
99echo.
100echo.Build finished; now you can process the JSON files.
101goto end
102)
103
104if "%1" == "htmlhelp" (
105%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
106if errorlevel 1 exit /b 1
107echo.
108echo.Build finished; now you can run HTML Help Workshop with the ^
109.hhp project file in %BUILDDIR%/htmlhelp.
110goto end
111)
112
113if "%1" == "qthelp" (
114%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
115if errorlevel 1 exit /b 1
116echo.
117echo.Build finished; now you can run "qcollectiongenerator" with the ^
118.qhcp project file in %BUILDDIR%/qthelp, like this:
119echo.^> qcollectiongenerator %BUILDDIR%\qthelp\libuv.qhcp
120echo.To view the help file:
121echo.^> assistant -collectionFile %BUILDDIR%\qthelp\libuv.ghc
122goto end
123)
124
125if "%1" == "devhelp" (
126%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
127if errorlevel 1 exit /b 1
128echo.
129echo.Build finished.
130goto end
131)
132
133if "%1" == "epub" (
134%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
135if errorlevel 1 exit /b 1
136echo.
137echo.Build finished. The epub file is in %BUILDDIR%/epub.
138goto end
139)
140
141if "%1" == "latex" (
142%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
143if errorlevel 1 exit /b 1
144echo.
145echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
146goto end
147)
148
149if "%1" == "latexpdf" (
150%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
151cd %BUILDDIR%/latex
152make all-pdf
153cd %BUILDDIR%/..
154echo.
155echo.Build finished; the PDF files are in %BUILDDIR%/latex.
156goto end
157)
158
159if "%1" == "latexpdfja" (
160%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
161cd %BUILDDIR%/latex
162make all-pdf-ja
163cd %BUILDDIR%/..
164echo.
165echo.Build finished; the PDF files are in %BUILDDIR%/latex.
166goto end
167)
168
169if "%1" == "text" (
170%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
171if errorlevel 1 exit /b 1
172echo.
173echo.Build finished. The text files are in %BUILDDIR%/text.
174goto end
175)
176
177if "%1" == "man" (
178%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
179if errorlevel 1 exit /b 1
180echo.
181echo.Build finished. The manual pages are in %BUILDDIR%/man.
182goto end
183)
184
185if "%1" == "texinfo" (
186%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
187if errorlevel 1 exit /b 1
188echo.
189echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
190goto end
191)
192
193if "%1" == "gettext" (
194%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
195if errorlevel 1 exit /b 1
196echo.
197echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
198goto end
199)
200
201if "%1" == "changes" (
202%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
203if errorlevel 1 exit /b 1
204echo.
205echo.The overview file is in %BUILDDIR%/changes.
206goto end
207)
208
209if "%1" == "linkcheck" (
210%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
211if errorlevel 1 exit /b 1
212echo.
213echo.Link check complete; look for any errors in the above output ^
214or in %BUILDDIR%/linkcheck/output.txt.
215goto end
216)
217
218if "%1" == "doctest" (
219%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
220if errorlevel 1 exit /b 1
221echo.
222echo.Testing of doctests in the sources finished, look at the ^
223results in %BUILDDIR%/doctest/output.txt.
224goto end
225)
226
227if "%1" == "xml" (
228%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
229if errorlevel 1 exit /b 1
230echo.
231echo.Build finished. The XML files are in %BUILDDIR%/xml.
232goto end
233)
234
235if "%1" == "pseudoxml" (
236%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
237if errorlevel 1 exit /b 1
238echo.
239echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
240goto end
241)
242
243:end
244