Skip to content

Commit 03b8a37

Browse files
torsavavstinner
authored andcommitted
[3.6] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (#1518)
* 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 (cherry picked from commit a1054c3) * [3.6] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-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. (cherry picked from commit a1054c3)
1 parent 72e1b61 commit 03b8a37

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
@@ -1002,7 +1002,7 @@ TESTTIMEOUT= 1200
10021002

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

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

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

10501050

@@ -1381,7 +1381,7 @@ LIBPL= @LIBPL@
13811381
# pkgconfig directory
13821382
LIBPC= $(LIBDIR)/pkgconfig
13831383

1384-
libainstall: all python-config
1384+
libainstall: @DEF_MAKE_RULE@ python-config
13851385
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
13861386
do \
13871387
if test ! -d $(DESTDIR)$$i; then \
@@ -1644,7 +1644,7 @@ distclean: clobber
16441644
-exec rm -f {} ';'
16451645

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

@@ -1681,7 +1681,7 @@ funny:
16811681
-o -print
16821682

16831683
# Perform some verification checks on any modified files.
1684-
patchcheck: all
1684+
patchcheck: @DEF_MAKE_RULE@
16851685
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
16861686

16871687
# Dependencies

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,7 @@ Jason Orendorff
11141114
Douglas Orr
11151115
William Orr
11161116
Michele Orrù
1117+
Tomáš Orsava
11171118
Oleg Oshmyan
11181119
Denis S. Otkidach
11191120
Peter Otten

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ Library
124124
Build
125125
-----
126126

127+
- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
128+
``make install`` and some other make targets when configured with
129+
``--enable-optimizations``.
130+
127131
- bpo-23404: Don't regenerate generated files based on file modification time
128132
anymore: the action is now explicit. Replace ``make touch`` with
129133
``make regen-all``.

0 commit comments

Comments
 (0)