mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
bpo-37725: have "make clean" remove PGO task data (#15033)
Change "clean" makefile target to also clean the program guided optimization (PGO) data. Previously you would have to use "make clean" and "make profile-removal", or "make clobber".
This commit is contained in:
parent
1ad0c776cb
commit
c6bbcd2583
2 changed files with 18 additions and 6 deletions
|
@ -461,7 +461,7 @@ check-clean-src:
|
||||||
|
|
||||||
# Profile generation build must start from a clean tree.
|
# Profile generation build must start from a clean tree.
|
||||||
profile-clean-stamp:
|
profile-clean-stamp:
|
||||||
$(MAKE) clean profile-removal
|
$(MAKE) clean
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
# Compile with profile generation enabled.
|
# Compile with profile generation enabled.
|
||||||
|
@ -485,7 +485,7 @@ profile-run-stamp:
|
||||||
$(MAKE) run_profile_task
|
$(MAKE) run_profile_task
|
||||||
$(MAKE) build_all_merge_profile
|
$(MAKE) build_all_merge_profile
|
||||||
# Remove profile generation binary since we are done with it.
|
# Remove profile generation binary since we are done with it.
|
||||||
$(MAKE) clean
|
$(MAKE) clean-retain-profile
|
||||||
# This is an expensive target to build and it does not have proper
|
# This is an expensive target to build and it does not have proper
|
||||||
# makefile dependency information. So, we create a "stamp" file
|
# makefile dependency information. So, we create a "stamp" file
|
||||||
# to record its completion and avoid re-running it.
|
# to record its completion and avoid re-running it.
|
||||||
|
@ -512,7 +512,7 @@ profile-opt: profile-run-stamp
|
||||||
.PHONY=coverage coverage-lcov coverage-report
|
.PHONY=coverage coverage-lcov coverage-report
|
||||||
coverage:
|
coverage:
|
||||||
@echo "Building with support for coverage checking:"
|
@echo "Building with support for coverage checking:"
|
||||||
$(MAKE) clean profile-removal
|
$(MAKE) clean
|
||||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
|
$(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
|
||||||
|
|
||||||
coverage-lcov:
|
coverage-lcov:
|
||||||
|
@ -1752,7 +1752,9 @@ docclean:
|
||||||
-rm -rf Doc/build
|
-rm -rf Doc/build
|
||||||
-rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
|
-rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
|
||||||
|
|
||||||
clean: pycremoval
|
# like the 'clean' target but retain the profile guided optimization (PGO)
|
||||||
|
# data. The PGO data is only valid if source code remains unchanged.
|
||||||
|
clean-retain-profile: pycremoval
|
||||||
find . -name '*.[oa]' -exec rm -f {} ';'
|
find . -name '*.[oa]' -exec rm -f {} ';'
|
||||||
find . -name '*.s[ol]' -exec rm -f {} ';'
|
find . -name '*.s[ol]' -exec rm -f {} ';'
|
||||||
find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
|
find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
|
||||||
|
@ -1774,14 +1776,19 @@ profile-removal:
|
||||||
rm -rf $(COVERAGE_REPORT)
|
rm -rf $(COVERAGE_REPORT)
|
||||||
rm -f profile-run-stamp
|
rm -f profile-run-stamp
|
||||||
|
|
||||||
clobber: clean profile-removal
|
clean: clean-retain-profile
|
||||||
|
@if test @DEF_MAKE_ALL_RULE@ = profile-opt; then \
|
||||||
|
rm -f profile-gen-stamp profile-clean-stamp; \
|
||||||
|
$(MAKE) profile-removal; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
clobber: clean
|
||||||
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
||||||
tags TAGS \
|
tags TAGS \
|
||||||
config.cache config.log pyconfig.h Modules/config.c
|
config.cache config.log pyconfig.h Modules/config.c
|
||||||
-rm -rf build platform
|
-rm -rf build platform
|
||||||
-rm -rf $(PYTHONFRAMEWORKDIR)
|
-rm -rf $(PYTHONFRAMEWORKDIR)
|
||||||
-rm -f python-config.py python-config
|
-rm -f python-config.py python-config
|
||||||
-rm -f profile-gen-stamp profile-clean-stamp
|
|
||||||
|
|
||||||
# Make things extra clean, before making a distribution:
|
# Make things extra clean, before making a distribution:
|
||||||
# remove all generated files, even Makefile[.pre]
|
# remove all generated files, even Makefile[.pre]
|
||||||
|
@ -1855,6 +1862,8 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
|
||||||
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
|
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
|
||||||
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
|
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
|
||||||
.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
|
.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
|
||||||
|
.PHONY: clean-retain-profile profile-removal run_profile_task
|
||||||
|
.PHONY: build_all_generate_profile build_all_merge_profile
|
||||||
.PHONY: gdbhooks
|
.PHONY: gdbhooks
|
||||||
|
|
||||||
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Change "clean" makefile target to also clean the program guided optimization
|
||||||
|
(PGO) data. Previously you would have to use "make clean" and "make
|
||||||
|
profile-removal", or "make clobber".
|
Loading…
Add table
Add a link
Reference in a new issue