@@ -188,54 +188,69 @@ dist:
188
188
mkdir -p dist
189
189
190
190
# archive the HTML
191
- make html
191
+ @echo "Building HTML..."
192
+ $(MAKE) html
192
193
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
193
194
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
194
195
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
195
196
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)
196
197
rm -r dist/python-$(DISTVERSION)-docs-html
197
198
rm dist/python-$(DISTVERSION)-docs-html.tar
199
+ @echo "Build finished and archived!"
198
200
199
201
# archive the text build
200
- make text
202
+ @echo "Building text..."
203
+ $(MAKE) text
201
204
cp -pPR build/text dist/python-$(DISTVERSION)-docs-text
202
205
tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text
203
206
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-text.tar
204
207
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-text.zip python-$(DISTVERSION)-docs-text)
205
208
rm -r dist/python-$(DISTVERSION)-docs-text
206
209
rm dist/python-$(DISTVERSION)-docs-text.tar
210
+ @echo "Build finished and archived!"
207
211
208
212
# archive the A4 latex
213
+ @echo "Building LaTeX (A4 paper)..."
209
214
rm -rf build/latex
210
- make latex PAPER=a4
211
- -sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
212
- (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
215
+ $(MAKE) latex PAPER=a4
216
+ # remove zip & bz2 dependency on all-pdf,
217
+ # as otherwise the full latexmk process is run twice.
218
+ # ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
219
+ -sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
220
+ (cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
213
221
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
214
222
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
223
+ @echo "Build finished and archived!"
215
224
216
225
# archive the letter latex
226
+ @echo "Building LaTeX (US paper)..."
217
227
rm -rf build/latex
218
- make latex PAPER=letter
219
- -sed -i 's/makeindex/makeindex -q /' build/latex/Makefile
220
- (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
228
+ $(MAKE) latex PAPER=letter
229
+ -sed -i 's/: all-$$(FMT)/: /' build/latex/Makefile
230
+ (cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
221
231
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
222
232
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
233
+ @echo "Build finished and archived!"
223
234
224
235
# copy the epub build
236
+ @echo "Building EPUB..."
225
237
rm -rf build/epub
226
- make epub
238
+ $(MAKE) epub
227
239
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
240
+ @echo "Build finished and archived!"
228
241
229
242
# archive the texinfo build
243
+ @echo "Building Texinfo..."
230
244
rm -rf build/texinfo
231
- make texinfo
232
- make info --directory=build/texinfo
245
+ $(MAKE) texinfo
246
+ $(MAKE) info --directory=build/texinfo
233
247
cp -pPR build/texinfo dist/python-$(DISTVERSION)-docs-texinfo
234
248
tar -C dist -cf dist/python-$(DISTVERSION)-docs-texinfo.tar python-$(DISTVERSION)-docs-texinfo
235
249
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-texinfo.tar
236
250
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-texinfo.zip python-$(DISTVERSION)-docs-texinfo)
237
251
rm -r dist/python-$(DISTVERSION)-docs-texinfo
238
252
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
253
+ @echo "Build finished and archived!"
239
254
240
255
.PHONY : _ensure-package
241
256
_ensure-package : venv
@@ -247,11 +262,11 @@ _ensure-package: venv
247
262
248
263
.PHONY : _ensure-pre-commit
249
264
_ensure-pre-commit :
250
- make _ensure-package PACKAGE=pre-commit
265
+ $( MAKE ) _ensure-package PACKAGE=pre-commit
251
266
252
267
.PHONY : _ensure-sphinx-autobuild
253
268
_ensure-sphinx-autobuild :
254
- make _ensure-package PACKAGE=sphinx-autobuild
269
+ $( MAKE ) _ensure-package PACKAGE=sphinx-autobuild
255
270
256
271
.PHONY : check
257
272
check : _ensure-pre-commit
@@ -271,12 +286,12 @@ serve:
271
286
# for development releases: always build
272
287
.PHONY : autobuild-dev
273
288
autobuild-dev :
274
- make dist SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
289
+ $( MAKE ) dist SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
275
290
276
291
# for quick rebuilds (HTML only)
277
292
.PHONY : autobuild-dev-html
278
293
autobuild-dev-html :
279
- make html SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
294
+ $( MAKE ) html SPHINXOPTS=' $(SPHINXOPTS) -Ea -A daily=1'
280
295
281
296
# for stable releases: only build if not in pre-release stage (alpha, beta)
282
297
# release candidate downloads are okay, since the stable tree can be in that stage
@@ -286,12 +301,12 @@ autobuild-stable:
286
301
echo " Not building; $( DISTVERSION) is not a release version." ; \
287
302
exit 1;; \
288
303
esac
289
- @make autobuild-dev
304
+ @$( MAKE ) autobuild-dev
290
305
291
306
.PHONY : autobuild-stable-html
292
307
autobuild-stable-html :
293
308
@case $(DISTVERSION ) in * [ab]* ) \
294
309
echo " Not building; $( DISTVERSION) is not a release version." ; \
295
310
exit 1;; \
296
311
esac
297
- @make autobuild-dev-html
312
+ @$( MAKE ) autobuild-dev-html
0 commit comments