Skip to content

Commit a1054c3

Browse files
torsavavstinner
authored andcommitted
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478)
* bpo-29243: Fix Makefile with respect to --enable-optimizations When using the Profile Guided Optimization (./configure --enable-optimizations) Python is built not only during `make` but rebuilt again during `make test`, `make install` and others. This patch fixes the issue. Note that this fix produces no change at all in the Makefile if configure is run witout --enable-optimizations. * !squash
1 parent c07b3a1 commit a1054c3

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Makefile.pre.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ TESTTIMEOUT= 1200
999999

10001000
# Run a basic set of regression tests.
10011001
# This excludes some tests that are particularly resource-intensive.
1002-
test: all platform
1002+
test: @DEF_MAKE_RULE@ platform
10031003
$(TESTRUNNER) $(TESTOPTS)
10041004

10051005
# Run the full test suite twice - once without .pyc files, and once with.
@@ -1009,7 +1009,7 @@ test: all platform
10091009
# the bytecode read from a .pyc file had the bug, sometimes the directly
10101010
# generated bytecode. This is sometimes a very shy bug needing a lot of
10111011
# sample data.
1012-
testall: all platform
1012+
testall: @DEF_MAKE_RULE@ platform
10131013
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
10141014
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
10151015
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
@@ -1018,7 +1018,7 @@ testall: all platform
10181018

10191019
# Run the test suite for both architectures in a Universal build on OSX.
10201020
# Must be run on an Intel box.
1021-
testuniversal: all platform
1021+
testuniversal: @DEF_MAKE_RULE@ platform
10221022
@if [ `arch` != 'i386' ]; then \
10231023
echo "This can only be used on OSX/i386" ;\
10241024
exit 1 ;\
@@ -1041,7 +1041,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
10411041
test_multiprocessing_forkserver \
10421042
test_mailbox test_socket test_poll \
10431043
test_select test_zipfile test_concurrent_futures
1044-
quicktest: all platform
1044+
quicktest: @DEF_MAKE_RULE@ platform
10451045
$(TESTRUNNER) $(QUICKTESTOPTS)
10461046

10471047

@@ -1378,7 +1378,7 @@ LIBPL= @LIBPL@
13781378
# pkgconfig directory
13791379
LIBPC= $(LIBDIR)/pkgconfig
13801380

1381-
libainstall: all python-config
1381+
libainstall: @DEF_MAKE_RULE@ python-config
13821382
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
13831383
do \
13841384
if test ! -d $(DESTDIR)$$i; then \
@@ -1640,7 +1640,7 @@ distclean: clobber
16401640
-exec rm -f {} ';'
16411641

16421642
# Check for smelly exported symbols (not starting with Py/_Py)
1643-
smelly: all
1643+
smelly: @DEF_MAKE_RULE@
16441644
nm -p $(LIBRARY) | \
16451645
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
16461646

@@ -1677,7 +1677,7 @@ funny:
16771677
-o -print
16781678

16791679
# Perform some verification checks on any modified files.
1680-
patchcheck: all
1680+
patchcheck: @DEF_MAKE_RULE@
16811681
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
16821682

16831683
# Dependencies

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ Bastien Orivel
11201120
Douglas Orr
11211121
William Orr
11221122
Michele Orrù
1123+
Tomáš Orsava
11231124
Oleg Oshmyan
11241125
Denis S. Otkidach
11251126
Peter Otten

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,10 @@ Documentation
10371037
Build
10381038
-----
10391039

1040+
- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
1041+
``make install`` and some other make targets when configured with
1042+
``--enable-optimizations``.
1043+
10401044
- bpo-23404: Don't regenerate generated files based on file modification time
10411045
anymore: the action is now explicit. Replace ``make touch`` with
10421046
``make regen-all``.

0 commit comments

Comments
 (0)