@@ -22,16 +22,14 @@ PAPEROPT_letter = -D latex_elements.papersize=letterpaper
22
22
ALLSPHINXOPTS = -b $(BUILDER ) -d build/doctrees $(PAPEROPT_$(PAPER ) ) -j $(JOBS ) \
23
23
$(SPHINXOPTS ) $(SPHINXERRORHANDLING ) . build/$(BUILDER ) $(SOURCES )
24
24
25
- .PHONY : help build html htmlhelp latex text texinfo changes linkcheck \
26
- suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
27
- autobuild-dev autobuild-stable venv
28
-
25
+ .PHONY : help
29
26
help :
30
27
@echo " Please use \` make <target>' where <target> is one of"
31
28
@echo " clean to remove build files"
32
29
@echo " venv to create a venv with necessary tools"
33
30
@echo " html to make standalone HTML files"
34
31
@echo " htmlview to open the index page built by the html target in your browser"
32
+ @echo " htmllive to rebuild and reload HTML files in your browser"
35
33
@echo " htmlhelp to make HTML files and a HTML help project"
36
34
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
37
35
@echo " text to make plain text files"
46
44
@echo " suspicious to check for suspicious markup in output text"
47
45
@echo " check to run a check for frequent markup errors"
48
46
47
+ .PHONY : build
49
48
build :
50
49
-mkdir -p build
51
50
# Look first for a Misc/NEWS file (building from a source release tarball
@@ -72,45 +71,54 @@ build:
72
71
$(SPHINXBUILD) $(ALLSPHINXOPTS)
73
72
@echo
74
73
74
+ .PHONY : html
75
75
html : BUILDER = html
76
76
html : build
77
77
@echo " Build finished. The HTML pages are in build/html."
78
78
79
+ .PHONY : htmlhelp
79
80
htmlhelp : BUILDER = htmlhelp
80
81
htmlhelp : build
81
82
@echo " Build finished; now you can run HTML Help Workshop with the" \
82
83
" build/htmlhelp/pydoc.hhp project file."
83
84
85
+ .PHONY : latex
84
86
latex : BUILDER = latex
85
87
latex : build
86
88
@echo " Build finished; the LaTeX files are in build/latex."
87
89
@echo " Run \` make all-pdf' or \` make all-ps' in that directory to" \
88
90
" run these through (pdf)latex."
89
91
92
+ .PHONY : text
90
93
text : BUILDER = text
91
94
text : build
92
95
@echo " Build finished; the text files are in build/text."
93
96
97
+ .PHONY : texinfo
94
98
texinfo : BUILDER = texinfo
95
99
texinfo : build
96
100
@echo " Build finished; the python.texi file is in build/texinfo."
97
101
@echo " Run \` make info' in that directory to run it through makeinfo."
98
102
103
+ .PHONY : epub
99
104
epub : BUILDER = epub
100
105
epub : build
101
106
@echo " Build finished; the epub files are in build/epub."
102
107
108
+ .PHONY : changes
103
109
changes : BUILDER = changes
104
110
changes : build
105
111
@echo " The overview file is in build/changes."
106
112
113
+ .PHONY : linkcheck
107
114
linkcheck : BUILDER = linkcheck
108
115
linkcheck :
109
116
@$(MAKE ) build BUILDER=$(BUILDER ) || { \
110
117
echo " Link check complete; look for any errors in the above output" \
111
118
" or in build/$( BUILDER) /output.txt" ; \
112
119
false ; }
113
120
121
+ .PHONY : suspicious
114
122
suspicious : BUILDER = suspicious
115
123
suspicious :
116
124
@$(MAKE ) build BUILDER=$(BUILDER ) || { \
@@ -123,31 +131,43 @@ suspicious:
123
131
@echo " ⚠ make check"
124
132
@echo " ⚠ instead."
125
133
134
+ .PHONY : coverage
126
135
coverage : BUILDER = coverage
127
136
coverage : build
128
137
@echo " Coverage finished; see c.txt and python.txt in build/coverage"
129
138
139
+ .PHONY : doctest
130
140
doctest : BUILDER = doctest
131
141
doctest :
132
142
@$(MAKE ) build BUILDER=$(BUILDER ) || { \
133
143
echo " Testing of doctests in the sources finished, look at the" \
134
144
" results in build/doctest/output.txt" ; \
135
145
false ; }
136
146
147
+ .PHONY : pydoc-topics
137
148
pydoc-topics : BUILDER = pydoc-topics
138
149
pydoc-topics : build
139
150
@echo " Building finished; now run this:" \
140
151
" cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
141
152
153
+ .PHONY : htmlview
142
154
htmlview : html
143
155
$(PYTHON ) -c " import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
144
156
157
+ .PHONY : htmllive
158
+ htmllive : SPHINXBUILD = $(VENVDIR ) /bin/sphinx-autobuild
159
+ htmllive : SPHINXOPTS = --re-ignore="/venv/"
160
+ htmllive : html
161
+
162
+ .PHONY : clean
145
163
clean : clean-venv
146
164
-rm -rf build/*
147
165
166
+ .PHONY : clean-venv
148
167
clean-venv :
149
168
rm -rf $(VENVDIR )
150
169
170
+ .PHONY : venv
151
171
venv :
152
172
@if [ -d $( VENVDIR) ] ; then \
153
173
echo " venv already exists." ; \
@@ -159,6 +179,7 @@ venv:
159
179
echo " The venv has been created in the $( VENVDIR) directory" ; \
160
180
fi
161
181
182
+ .PHONY : dist
162
183
dist :
163
184
rm -rf dist
164
185
mkdir -p dist
@@ -213,10 +234,12 @@ dist:
213
234
rm -r dist/python-$(DISTVERSION)-docs-texinfo
214
235
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
215
236
237
+ .PHONY : check
216
238
check : venv
217
239
$(VENVDIR ) /bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR ) /bin/python3 -m pip install pre-commit
218
240
$(VENVDIR ) /bin/python3 -m pre_commit run --all-files
219
241
242
+ .PHONY : serve
220
243
serve :
221
244
@echo " The serve target was removed, use htmlview instead (see bpo-36329)"
222
245
@@ -228,22 +251,26 @@ serve:
228
251
# output files)
229
252
230
253
# for development releases: always build
254
+ .PHONY : autobuild-dev
231
255
autobuild-dev :
232
256
make dist SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
233
257
234
258
# for quick rebuilds (HTML only)
259
+ .PHONY : autobuild-dev-html
235
260
autobuild-dev-html :
236
261
make html SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
237
262
238
263
# for stable releases: only build if not in pre-release stage (alpha, beta)
239
264
# release candidate downloads are okay, since the stable tree can be in that stage
265
+ .PHONY : autobuild-stable
240
266
autobuild-stable :
241
267
@case $(DISTVERSION ) in * [ab]* ) \
242
268
echo " Not building; $( DISTVERSION) is not a release version." ; \
243
269
exit 1;; \
244
270
esac
245
271
@make autobuild-dev
246
272
273
+ .PHONY : autobuild-stable-html
247
274
autobuild-stable-html :
248
275
@case $(DISTVERSION ) in * [ab]* ) \
249
276
echo " Not building; $( DISTVERSION) is not a release version." ; \
0 commit comments