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