@@ -9,6 +9,7 @@ VENVDIR = ./venv
9
9
SPHINXBUILD = PATH=$(VENVDIR ) /bin:$$PATH sphinx-build
10
10
SPHINXLINT = PATH=$(VENVDIR ) /bin:$$PATH sphinx-lint
11
11
BLURB = PATH=$(VENVDIR ) /bin:$$PATH blurb
12
+ JOBS = auto
12
13
PAPER =
13
14
SOURCES =
14
15
DISTVERSION = $(shell $(PYTHON ) tools/extensions/patchlevel.py)
@@ -18,13 +19,10 @@ SPHINXERRORHANDLING = -W
18
19
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
19
20
PAPEROPT_letter = -D latex_elements.papersize=letterpaper
20
21
21
- ALLSPHINXOPTS = -b $(BUILDER ) -d build/doctrees $(PAPEROPT_$(PAPER ) ) -j auto \
22
+ ALLSPHINXOPTS = -b $(BUILDER ) -d build/doctrees $(PAPEROPT_$(PAPER ) ) -j $( JOBS ) \
22
23
$(SPHINXOPTS ) $(SPHINXERRORHANDLING ) . build/$(BUILDER ) $(SOURCES )
23
24
24
- .PHONY : help build html htmlhelp latex text texinfo epub changes linkcheck \
25
- coverage doctest pydoc-topics htmlview clean clean-venv venv dist check serve \
26
- autobuild-dev autobuild-dev-html autobuild-stable autobuild-stable-html
27
-
25
+ .PHONY : help
28
26
help :
29
27
@echo " Please use \` make <target>' where <target> is one of"
30
28
@echo " clean to remove build files"
44
42
@echo " dist to create a \" dist\" directory with archived docs for download"
45
43
@echo " check to run a check for frequent markup errors"
46
44
45
+ .PHONY : build
47
46
build :
48
47
-mkdir -p build
49
48
# Look first for a Misc/NEWS file (building from a source release tarball
@@ -70,70 +69,85 @@ build:
70
69
$(SPHINXBUILD) $(ALLSPHINXOPTS)
71
70
@echo
72
71
72
+ .PHONY : html
73
73
html : BUILDER = html
74
74
html : build
75
75
@echo " Build finished. The HTML pages are in build/html."
76
76
77
+ .PHONY : htmlhelp
77
78
htmlhelp : BUILDER = htmlhelp
78
79
htmlhelp : build
79
80
@echo " Build finished; now you can run HTML Help Workshop with the" \
80
81
" build/htmlhelp/pydoc.hhp project file."
81
82
83
+ .PHONY : latex
82
84
latex : BUILDER = latex
83
85
latex : build
84
86
@echo " Build finished; the LaTeX files are in build/latex."
85
87
@echo " Run \` make all-pdf' or \` make all-ps' in that directory to" \
86
88
" run these through (pdf)latex."
87
89
90
+ .PHONY : text
88
91
text : BUILDER = text
89
92
text : build
90
93
@echo " Build finished; the text files are in build/text."
91
94
95
+ .PHONY : texinfo
92
96
texinfo : BUILDER = texinfo
93
97
texinfo : build
94
98
@echo " Build finished; the python.texi file is in build/texinfo."
95
99
@echo " Run \` make info' in that directory to run it through makeinfo."
96
100
101
+ .PHONY : epub
97
102
epub : BUILDER = epub
98
103
epub : build
99
104
@echo " Build finished; the epub files are in build/epub."
100
105
106
+ .PHONY : changes
101
107
changes : BUILDER = changes
102
108
changes : build
103
109
@echo " The overview file is in build/changes."
104
110
111
+ .PHONY : linkcheck
105
112
linkcheck : BUILDER = linkcheck
106
113
linkcheck :
107
114
@$(MAKE ) build BUILDER=$(BUILDER ) || { \
108
115
echo " Link check complete; look for any errors in the above output" \
109
116
" or in build/$( BUILDER) /output.txt" ; \
110
117
false ; }
111
118
119
+ .PHONY : coverage
112
120
coverage : BUILDER = coverage
113
121
coverage : build
114
122
@echo " Coverage finished; see c.txt and python.txt in build/coverage"
115
123
124
+ .PHONY : doctest
116
125
doctest : BUILDER = doctest
117
126
doctest :
118
127
@$(MAKE ) build BUILDER=$(BUILDER ) || { \
119
128
echo " Testing of doctests in the sources finished, look at the" \
120
129
" results in build/doctest/output.txt" ; \
121
130
false ; }
122
131
132
+ .PHONY : pydoc-topics
123
133
pydoc-topics : BUILDER = pydoc-topics
124
134
pydoc-topics : build
125
135
@echo " Building finished; now run this:" \
126
136
" cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
127
137
138
+ .PHONY : htmlview
128
139
htmlview : html
129
140
$(PYTHON ) -c " import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
130
141
142
+ .PHONY : clean
131
143
clean : clean-venv
132
144
-rm -rf build/*
133
145
146
+ .PHONY : clean-venv
134
147
clean-venv :
135
148
rm -rf $(VENVDIR )
136
149
150
+ .PHONY : venv
137
151
venv :
138
152
@if [ -d $( VENVDIR) ] ; then \
139
153
echo " venv already exists." ; \
@@ -145,6 +159,7 @@ venv:
145
159
echo " The venv has been created in the $( VENVDIR) directory" ; \
146
160
fi
147
161
162
+ .PHONY : dist
148
163
dist :
149
164
rm -rf dist
150
165
mkdir -p dist
@@ -199,12 +214,14 @@ dist:
199
214
rm -r dist/python-$(DISTVERSION)-docs-texinfo
200
215
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
201
216
217
+ .PHONY : check
202
218
check :
203
219
# Check the docs and NEWS files with sphinx-lint.
204
220
# Ignore the tools and venv dirs and check that the default role is not used.
205
221
$(SPHINXLINT ) -i tools -i $(VENVDIR ) --enable default-role
206
222
$(SPHINXLINT ) --enable default-role ../Misc/NEWS.d/next/
207
223
224
+ .PHONY : serve
208
225
serve :
209
226
@echo " The serve target was removed, use htmlview instead (see bpo-36329)"
210
227
@@ -216,22 +233,26 @@ serve:
216
233
# output files)
217
234
218
235
# for development releases: always build
236
+ .PHONY : autobuild-dev
219
237
autobuild-dev :
220
238
make dist SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
221
239
222
240
# for quick rebuilds (HTML only)
241
+ .PHONY : autobuild-dev-html
223
242
autobuild-dev-html :
224
243
make html SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
225
244
226
245
# for stable releases: only build if not in pre-release stage (alpha, beta)
227
246
# release candidate downloads are okay, since the stable tree can be in that stage
247
+ .PHONY : autobuild-stable
228
248
autobuild-stable :
229
249
@case $(DISTVERSION ) in * [ab]* ) \
230
250
echo " Not building; $( DISTVERSION) is not a release version." ; \
231
251
exit 1;; \
232
252
esac
233
253
@make autobuild-dev
234
254
255
+ .PHONY : autobuild-stable-html
235
256
autobuild-stable-html :
236
257
@case $(DISTVERSION ) in * [ab]* ) \
237
258
echo " Not building; $( DISTVERSION) is not a release version." ; \
0 commit comments