summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-03-31 01:24:02 (GMT)
committerGitHub <noreply@github.com>2022-03-31 01:24:02 (GMT)
commitdb4dada5108dd49ebca23e4559a53630a2df8447 (patch)
tree77985d02dd51165ccc9cf64f5a3448b66a88aa40 /Makefile.pre.in
parentf3d5715492195fd2532fc1a5d73be07923cdf2e1 (diff)
downloadcpython-db4dada5108dd49ebca23e4559a53630a2df8447.zip
cpython-db4dada5108dd49ebca23e4559a53630a2df8447.tar.gz
cpython-db4dada5108dd49ebca23e4559a53630a2df8447.tar.bz2
bpo-47146: Avoid Using make Recursively (gh-32206)
https://bugs.python.org/issue47146
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index e6c6a6b..8d335a7 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1136,10 +1136,7 @@ regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN)
# Deepfreeze targets
.PHONY: regen-deepfreeze
-regen-deepfreeze:
- @# Possibly generate globals first, to make sure _bootstrap_python builds.
- $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_global_objects.py
- $(MAKE) $(DEEPFREEZE_OBJS)
+regen-deepfreeze: $(DEEPFREEZE_OBJS)
DEEPFREEZE_DEPS=$(srcdir)/Tools/scripts/deepfreeze.py $(FREEZE_MODULE_DEPS) $(FROZEN_FILES_OUT)
@@ -1180,13 +1177,25 @@ regen-importlib: regen-frozen
############################################################################
# Global objects
-.PHONY: regen-global-objects
-regen-global-objects: regen-deepfreeze
- @# We already ran in once, before deepfreezing, to make sure
- @# _bootstrap_python builds. Now we run it again to catch any
- @# remaining globals, including those added by deepfreeze.
+GLOBAL_OBJECTS_TARGETS = \
+ $(srcdir)/Include/internal/pycore_global_objects.h \
+ $(srcdir)/Include/internal/pycore_global_strings.h
+
+# The global objects will get regenerated as soon these files
+# are required, including as a prerequisite for regen-deepfreeze.
+$(GLOBAL_OBJECTS_TARGETS): generate-global-objects
+
+.PHONY: generate-global-objects
+generate-global-objects: $(srcdir)/Tools/scripts/generate_global_objects.py
$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_global_objects.py
+.PHONY: generate-global-objects-after-deepfreeze
+generate-global-objects-after-deepfreeze: regen-deepfreeze $(srcdir)/Tools/scripts/generate_global_objects.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_global_objects.py
+
+.PHONY: regen-global-objects
+regen-global-objects: regen-deepfreeze generate-global-objects-after-deepfreeze
+
############################################################################
# ABI