Skip to content

[2.7] bpo-31934: Abort when building out of a not clean source tree (… #4342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,16 @@ LIBRARY_OBJS= \

# Default target
all: @DEF_MAKE_ALL_RULE@
build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks

# Check that the source is clean when building out of source.
check-clean-src:
@if test -n "$(VPATH)" -a -f "$(srcdir)/Modules/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.
profile-opt:
Expand Down Expand Up @@ -928,7 +937,7 @@ altinstall: commoninstall
$$ensurepip --root=$(DESTDIR)/ ; \
fi

commoninstall: @FRAMEWORKALTINSTALLFIRST@ \
commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
altbininstall libinstall inclinstall libainstall \
sharedinstall oldsharedinstall altmaninstall \
@FRAMEWORKALTINSTALLLAST@
Expand Down Expand Up @@ -1472,7 +1481,7 @@ patchcheck:
Python/thread.o: @THREADHEADERS@

# Declare targets that aren't real files
.PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest memtest
.PHONY: install altinstall oldsharedinstall bininstall altbininstall
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Abort the build when building out of a not clean source tree.