Lines Matching +full:build +full:- +full:with +full:- +full:python
2 # Makefile for Python documentation
7 PYTHON = python3 macro
9 SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
10 SPHINXLINT = PATH=$(VENVDIR)/bin:$$PATH sphinx-lint
15 DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
17 SPHINXERRORHANDLING = -W
20 PAPEROPT_a4 = -D latex_elements.papersize=a4paper
21 PAPEROPT_letter = -D latex_elements.papersize=letterpaper
23 ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
24 $(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
26 .PHONY: help build html htmlhelp latex text texinfo changes linkcheck \
27 suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
28 autobuild-dev autobuild-stable venv
32 @echo " clean to remove build files"
33 @echo " venv to create a venv with necessary tools"
45 @echo " pydoc-topics to regenerate the pydoc topics file"
46 @echo " dist to create a \"dist\" directory with archived docs for download"
50 build: target
51 -mkdir -p build
55 @if [ -f ../Misc/NEWS ] ; then \
57 cp ../Misc/NEWS build/NEWS; \
58 elif $(BLURB) help >/dev/null 2>&1 && $(SPHINXBUILD) --version >/dev/null 2>&1; then \
59 if [ -d ../Misc/NEWS.d ]; then \
60 echo "Building NEWS from Misc/NEWS.d with blurb"; \
61 $(BLURB) merge -f build/NEWS; \
63 echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
68 echo "Missing the required blurb or sphinx-build tools."; \
77 html: build
78 @echo "Build finished. The HTML pages are in build/html."
81 htmlhelp: build
82 @echo "Build finished; now you can run HTML Help Workshop with the" \
83 "build/htmlhelp/pydoc.hhp project file."
86 latex: build
87 @echo "Build finished; the LaTeX files are in build/latex."
88 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
92 text: build
93 @echo "Build finished; the text files are in build/text."
96 texinfo: build
97 @echo "Build finished; the python.texi file is in build/texinfo."
101 epub: build
102 @echo "Build finished; the epub files are in build/epub."
105 changes: build
106 @echo "The overview file is in build/changes."
110 @$(MAKE) build BUILDER=$(BUILDER) || { \
112 "or in build/$(BUILDER)/output.txt"; \
117 @$(MAKE) build BUILDER=$(BUILDER) || { \
119 "or in build/$(BUILDER)/suspicious.csv. If all issues are false" \
120 "positives, append that file to tools/susp-ignored.csv."; \
128 coverage: build
129 @echo "Coverage finished; see c.txt and python.txt in build/coverage"
133 @$(MAKE) build BUILDER=$(BUILDER) || { \
135 "results in build/doctest/output.txt"; \
138 pydoc-topics: BUILDER = pydoc-topics
139 pydoc-topics: build
141 "cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
144 …$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/inde…
146 clean: clean-venv
147 -rm -rf build/*
149 clean-venv:
150 rm -rf $(VENVDIR)
153 @if [ -d $(VENVDIR) ] ; then \
155 echo "To recreate it, remove it first with \`make clean-venv'."; \
157 $(PYTHON) -m venv $(VENVDIR); \
158 $(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
159 $(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
164 rm -rf dist
165 mkdir -p dist
169 cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
170 tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
171 bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
172 (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)
173 rm -r dist/python-$(DISTVERSION)-docs-html
174 rm dist/python-$(DISTVERSION)-docs-html.tar
176 # archive the text build
178 cp -pPR build/text dist/python-$(DISTVERSION)-docs-text
179 tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text
180 bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar
181 (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
182 rm -r dist/python-$(DISTVERSION)-docs-text
183 rm dist/python-$(DISTVERSION)-docs-text.tar
186 rm -rf build/latex
188 -sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
189 (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
190 cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
191 cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
194 rm -rf build/latex
196 -sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
197 (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
198 cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
199 cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
201 # copy the epub build
202 rm -rf build/epub
204 cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
206 # archive the texinfo build
207 rm -rf build/texinfo
209 make info --directory=build/texinfo
210 cp -pPR build/texinfo dist/python-$(DISTVERSION)-docs-texinfo
211 tar -C dist -cf dist/python-$(DISTVERSION)-docs-texinfo.tar python-$(DISTVERSION)-docs-texinfo
212 bzip2 -9 -k dist/python-$(DISTVERSION)-docs-texinfo.tar
213 (cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-texinfo.zip python-$(DISTVERSION)-docs-texinfo)
214 rm -r dist/python-$(DISTVERSION)-docs-texinfo
215 rm dist/python-$(DISTVERSION)-docs-texinfo.tar
218 # Check the docs and NEWS files with sphinx-lint.
220 $(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
221 $(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
224 @echo "The serve target was removed, use htmlview instead (see bpo-36329)"
226 # Targets for daily automated doc build
229 # To ensure such changes are picked up, we build the published docs with
230 # `-E` (to ignore the cached environment) and `-a` (to ignore already existing
233 # for development releases: always build
234 autobuild-dev:
235 make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
238 autobuild-dev-html:
239 make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
241 # for stable releases: only build if not in pre-release stage (alpha, beta)
243 autobuild-stable:
248 @make autobuild-dev
250 autobuild-stable-html:
255 @make autobuild-dev-html