Unverified Kaydet (Commit) 0c4785bf authored tarafından xdegaye's avatar xdegaye Kaydeden (comit) GitHub

[3.6] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4340)

(cherry picked from commit 0de92859)
üst ac4f6d44
...@@ -440,7 +440,17 @@ DTRACE_DEPS = \ ...@@ -440,7 +440,17 @@ DTRACE_DEPS = \
# Default target # Default target
all: @DEF_MAKE_ALL_RULE@ all: @DEF_MAKE_ALL_RULE@
build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
Programs/_testembed python-config
# Check that the source is clean when building out of source.
check-clean-src:
@if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
echo "Error: The source directory ($(srcdir)) is not clean" ; \
echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
echo "Try to run: make -C \"$(srcdir)\" clean" ; \
exit 1; \
fi
# Compile a binary with profile guided optimization. # Compile a binary with profile guided optimization.
profile-opt: profile-opt:
...@@ -530,7 +540,7 @@ coverage-report: regen-grammar regen-importlib ...@@ -530,7 +540,7 @@ coverage-report: regen-grammar regen-importlib
# Run "Argument Clinic" over all source files # Run "Argument Clinic" over all source files
# (depends on python having already been built) # (depends on python having already been built)
.PHONY=clinic .PHONY=clinic
clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c clinic: check-clean-src $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c
$(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make
# Build the interpreter # Build the interpreter
...@@ -1091,7 +1101,7 @@ altinstall: commoninstall ...@@ -1091,7 +1101,7 @@ altinstall: commoninstall
$$ensurepip --root=$(DESTDIR)/ ; \ $$ensurepip --root=$(DESTDIR)/ ; \
fi fi
commoninstall: @FRAMEWORKALTINSTALLFIRST@ \ commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
altbininstall libinstall inclinstall libainstall \ altbininstall libinstall inclinstall libainstall \
sharedinstall oldsharedinstall altmaninstall \ sharedinstall oldsharedinstall altmaninstall \
@FRAMEWORKALTINSTALLLAST@ @FRAMEWORKALTINSTALLLAST@
...@@ -1714,7 +1724,7 @@ patchcheck: @DEF_MAKE_RULE@ ...@@ -1714,7 +1724,7 @@ patchcheck: @DEF_MAKE_RULE@
Python/thread.o: @THREADHEADERS@ Python/thread.o: @THREADHEADERS@
# Declare targets that aren't real files # Declare targets that aren't real files
.PHONY: all build_all sharedmods oldsharedmods test quicktest .PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest
.PHONY: install altinstall oldsharedinstall bininstall altbininstall .PHONY: install altinstall oldsharedinstall bininstall altbininstall
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
......
Abort the build when building out of a not clean source tree.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment