@@ -9,6 +9,7 @@ VENVDIR = ./venv
99SPHINXBUILD = PATH=$(VENVDIR ) /bin:$$PATH sphinx-build
1010SPHINXLINT = PATH=$(VENVDIR ) /bin:$$PATH sphinx-lint
1111BLURB = PATH=$(VENVDIR ) /bin:$$PATH blurb
12+ JOBS = auto
1213PAPER =
1314SOURCES =
1415DISTVERSION = $(shell $(PYTHON ) tools/extensions/patchlevel.py)
@@ -18,13 +19,10 @@ SPHINXERRORHANDLING = -W
1819PAPEROPT_a4 = -D latex_elements.papersize=a4paper
1920PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2021
21- ALLSPHINXOPTS = -b $(BUILDER ) -d build/doctrees $(PAPEROPT_$(PAPER ) ) -j auto \
22+ ALLSPHINXOPTS = -b $(BUILDER ) -d build/doctrees $(PAPEROPT_$(PAPER ) ) -j $( JOBS ) \
2223 $(SPHINXOPTS ) $(SPHINXERRORHANDLING ) . build/$(BUILDER ) $(SOURCES )
2324
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
2826help :
2927 @echo " Please use \` make <target>' where <target> is one of"
3028 @echo " clean to remove build files"
4442 @echo " dist to create a \" dist\" directory with archived docs for download"
4543 @echo " check to run a check for frequent markup errors"
4644
45+ .PHONY : build
4746build :
4847 -mkdir -p build
4948# Look first for a Misc/NEWS file (building from a source release tarball
@@ -70,70 +69,85 @@ build:
7069 $(SPHINXBUILD) $(ALLSPHINXOPTS)
7170 @echo
7271
72+ .PHONY : html
7373html : BUILDER = html
7474html : build
7575 @echo " Build finished. The HTML pages are in build/html."
7676
77+ .PHONY : htmlhelp
7778htmlhelp : BUILDER = htmlhelp
7879htmlhelp : build
7980 @echo " Build finished; now you can run HTML Help Workshop with the" \
8081 " build/htmlhelp/pydoc.hhp project file."
8182
83+ .PHONY : latex
8284latex : BUILDER = latex
8385latex : build
8486 @echo " Build finished; the LaTeX files are in build/latex."
8587 @echo " Run \` make all-pdf' or \` make all-ps' in that directory to" \
8688 " run these through (pdf)latex."
8789
90+ .PHONY : text
8891text : BUILDER = text
8992text : build
9093 @echo " Build finished; the text files are in build/text."
9194
95+ .PHONY : texinfo
9296texinfo : BUILDER = texinfo
9397texinfo : build
9498 @echo " Build finished; the python.texi file is in build/texinfo."
9599 @echo " Run \` make info' in that directory to run it through makeinfo."
96100
101+ .PHONY : epub
97102epub : BUILDER = epub
98103epub : build
99104 @echo " Build finished; the epub files are in build/epub."
100105
106+ .PHONY : changes
101107changes : BUILDER = changes
102108changes : build
103109 @echo " The overview file is in build/changes."
104110
111+ .PHONY : linkcheck
105112linkcheck : BUILDER = linkcheck
106113linkcheck :
107114 @$(MAKE ) build BUILDER=$(BUILDER ) || { \
108115 echo " Link check complete; look for any errors in the above output" \
109116 " or in build/$( BUILDER) /output.txt" ; \
110117 false ; }
111118
119+ .PHONY : coverage
112120coverage : BUILDER = coverage
113121coverage : build
114122 @echo " Coverage finished; see c.txt and python.txt in build/coverage"
115123
124+ .PHONY : doctest
116125doctest : BUILDER = doctest
117126doctest :
118127 @$(MAKE ) build BUILDER=$(BUILDER ) || { \
119128 echo " Testing of doctests in the sources finished, look at the" \
120129 " results in build/doctest/output.txt" ; \
121130 false ; }
122131
132+ .PHONY : pydoc-topics
123133pydoc-topics : BUILDER = pydoc-topics
124134pydoc-topics : build
125135 @echo " Building finished; now run this:" \
126136 " cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
127137
138+ .PHONY : htmlview
128139htmlview : html
129140 $(PYTHON ) -c " import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
130141
142+ .PHONY : clean
131143clean : clean-venv
132144 -rm -rf build/*
133145
146+ .PHONY : clean-venv
134147clean-venv :
135148 rm -rf $(VENVDIR )
136149
150+ .PHONY : venv
137151venv :
138152 @if [ -d $( VENVDIR) ] ; then \
139153 echo " venv already exists." ; \
@@ -145,6 +159,7 @@ venv:
145159 echo " The venv has been created in the $( VENVDIR) directory" ; \
146160 fi
147161
162+ .PHONY : dist
148163dist :
149164 rm -rf dist
150165 mkdir -p dist
@@ -199,12 +214,14 @@ dist:
199214 rm -r dist/python-$(DISTVERSION)-docs-texinfo
200215 rm dist/python-$(DISTVERSION)-docs-texinfo.tar
201216
217+ .PHONY : check
202218check :
203219 # Check the docs and NEWS files with sphinx-lint.
204220 # Ignore the tools and venv dirs and check that the default role is not used.
205221 $(SPHINXLINT ) -i tools -i $(VENVDIR ) --enable default-role
206222 $(SPHINXLINT ) --enable default-role ../Misc/NEWS.d/next/
207223
224+ .PHONY : serve
208225serve :
209226 @echo " The serve target was removed, use htmlview instead (see bpo-36329)"
210227
@@ -216,22 +233,26 @@ serve:
216233# output files)
217234
218235# for development releases: always build
236+ .PHONY : autobuild-dev
219237autobuild-dev :
220238 make dist SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
221239
222240# for quick rebuilds (HTML only)
241+ .PHONY : autobuild-dev-html
223242autobuild-dev-html :
224243 make html SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
225244
226245# for stable releases: only build if not in pre-release stage (alpha, beta)
227246# release candidate downloads are okay, since the stable tree can be in that stage
247+ .PHONY : autobuild-stable
228248autobuild-stable :
229249 @case $(DISTVERSION ) in * [ab]* ) \
230250 echo " Not building; $( DISTVERSION) is not a release version." ; \
231251 exit 1;; \
232252 esac
233253 @make autobuild-dev
234254
255+ .PHONY : autobuild-stable-html
235256autobuild-stable-html :
236257 @case $(DISTVERSION ) in * [ab]* ) \
237258 echo " Not building; $( DISTVERSION) is not a release version." ; \
0 commit comments