bpo-31934: Abort when building out of a not clean source tree (GH-4255) · python/cpython@0de9285 (original) (raw)

`@@ -440,7 +440,17 @@ DTRACE_DEPS = \

`

440

440

``

441

441

`# Default target

`

442

442

`all: @DEF_MAKE_ALL_RULE@

`

443

``

`-

build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config

`

``

443

`+

build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \

`

``

444

`+

Programs/_testembed python-config

`

``

445

+

``

446

`+

Check that the source is clean when building out of source.

`

``

447

`+

check-clean-src:

`

``

448

`+

@if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \

`

``

449

`+

echo "Error: The source directory ($(srcdir)) is not clean" ; \

`

``

450

`+

echo "Building Python out of the source tree (in (absbuilddir))requiresacleansourcetree((abs_builddir)) requires a clean source tree ((absbuilddir))requiresacleansourcetree((abs_srcdir))" ; \

`

``

451

`+

echo "Try to run: make -C "$(srcdir)" clean" ; \

`

``

452

`+

exit 1; \

`

``

453

`+

fi

`

444

454

``

445

455

`# Profile generation build must start from a clean tree.

`

446

456

`profile-clean-stamp:

`

`@@ -542,7 +552,7 @@ coverage-report: regen-grammar regen-importlib

`

542

552

`# Run "Argument Clinic" over all source files

`

543

553

`# (depends on python having already been built)

`

544

554

`.PHONY=clinic

`

545

``

`-

clinic: (BUILDPYTHON)(BUILDPYTHON) (BUILDPYTHON)(srcdir)/Modules/_blake2/blake2s_impl.c

`

``

555

`+

clinic: check-clean-src (BUILDPYTHON)(BUILDPYTHON) (BUILDPYTHON)(srcdir)/Modules/_blake2/blake2s_impl.c

`

546

556

` (RUNSHARED)(RUNSHARED) (RUNSHARED)(PYTHON_FOR_BUILD) (srcdir)/Tools/clinic/clinic.py−−make−−srcdir(srcdir)/Tools/clinic/clinic.py --make --srcdir (srcdir)/Tools/clinic/clinic.pymakesrcdir(srcdir)

`

547

557

``

548

558

`# Build the interpreter

`

`@@ -1100,7 +1110,7 @@ altinstall: commoninstall

`

1100

1110

` ensurepip --root=$(DESTDIR)/ ; \

`

1101

1111

` fi

`

1102

1112

``

1103

``

`-

commoninstall: @FRAMEWORKALTINSTALLFIRST@ \

`

``

1113

`+

commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \

`

1104

1114

` altbininstall libinstall inclinstall libainstall \

`

1105

1115

` sharedinstall oldsharedinstall altmaninstall \

`

1106

1116

` @FRAMEWORKALTINSTALLLAST@

`

`@@ -1722,7 +1732,7 @@ patchcheck: @DEF_MAKE_RULE@

`

1722

1732

`Python/thread.o: @THREADHEADERS@

`

1723

1733

``

1724

1734

`# Declare targets that aren't real files

`

1725

``

`-

.PHONY: all build_all sharedmods oldsharedmods test quicktest

`

``

1735

`+

.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest

`

1726

1736

`.PHONY: install altinstall oldsharedinstall bininstall altbininstall

`

1727

1737

`.PHONY: maninstall libinstall inclinstall libainstall sharedinstall

`

1728

1738

`.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure

`