summaryrefslogtreecommitdiff
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-09-20 23:57:56 +0200
committerVictor Stinner <victor.stinner@gmail.com>2017-09-20 14:57:56 -0700
commitb091bec824137f286b22084be5f8d397d21b9abb (patch)
tree39ac8ea636a3df84dd613007e0dfa6209736db73 /Makefile.pre.in
parentaaf6fc0982c916cb71d9e0afcd7dda4ba495793b (diff)
downloadcpython-git-b091bec824137f286b22084be5f8d397d21b9abb.tar.gz
bpo-31536: Avoid wholesale rebuild after `make regen-all` (#3678)
* bpo-31536: Avoid wholesale rebuild after `make regen-all` * Add NEWS
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in28
1 files changed, 19 insertions, 9 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 5a001ecbe7..8f4918dff6 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -230,6 +230,7 @@ PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
+UPDATE_FILE=@PYTHON_FOR_REGEN@ $(srcdir)/Tools/scripts/update_file.py
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
BUILD_GNU_TYPE= @build@
@@ -691,12 +692,14 @@ regen-importlib: Programs/_freeze_importlib
# from Lib/importlib/_bootstrap_external.py using _freeze_importlib
./Programs/_freeze_importlib \
$(srcdir)/Lib/importlib/_bootstrap_external.py \
- $(srcdir)/Python/importlib_external.h
+ $(srcdir)/Python/importlib_external.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/importlib_external.h $(srcdir)/Python/importlib_external.h.new
# Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py
# using _freeze_importlib
./Programs/_freeze_importlib \
$(srcdir)/Lib/importlib/_bootstrap.py \
- $(srcdir)/Python/importlib.h
+ $(srcdir)/Python/importlib.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new
############################################################################
@@ -770,8 +773,10 @@ regen-grammar: $(PGEN)
# from Grammar/Grammar using pgen
@$(MKDIR_P) Include
$(PGEN) $(srcdir)/Grammar/Grammar \
- $(srcdir)/Include/graminit.h \
- $(srcdir)/Python/graminit.c
+ $(srcdir)/Include/graminit.h.new \
+ $(srcdir)/Python/graminit.c.new
+ $(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new
Parser/grammar.o: $(srcdir)/Parser/grammar.c \
$(srcdir)/Include/token.h \
@@ -789,13 +794,15 @@ regen-ast:
# Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
$(MKDIR_P) $(srcdir)/Include
$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
- -h $(srcdir)/Include \
+ -h $(srcdir)/Include/Python-ast.h.new \
$(srcdir)/Parser/Python.asdl
+ $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new
# Regenerate Python/Python-ast.c using Parser/asdl_c.py -c
$(MKDIR_P) $(srcdir)/Python
$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
- -c $(srcdir)/Python \
+ -c $(srcdir)/Python/Python-ast.c.new \
$(srcdir)/Parser/Python.asdl
+ $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
.PHONY: regen-opcode
regen-opcode:
@@ -803,7 +810,8 @@ regen-opcode:
# using Tools/scripts/generate_opcode_h.py
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \
$(srcdir)/Lib/opcode.py \
- $(srcdir)/Include/opcode.h
+ $(srcdir)/Include/opcode.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new
Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
@@ -860,7 +868,8 @@ regen-opcode-targets:
# Regenerate Python/opcode_targets.h from Lib/opcode.py
# using Python/makeopcodetargets.py
$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
- $(srcdir)/Python/opcode_targets.h
+ $(srcdir)/Python/opcode_targets.h.new
+ $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h
@@ -887,7 +896,8 @@ regen-typeslots:
# using Objects/typeslots.py
$(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
< $(srcdir)/Include/typeslots.h \
- $(srcdir)/Objects/typeslots.inc
+ $(srcdir)/Objects/typeslots.inc.new
+ $(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new
############################################################################
# Header files