summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-04-12 15:34:06 (GMT)
committerGitHub <noreply@github.com>2022-04-12 15:34:06 (GMT)
commit474fdbe9e4a2ff90ef39e8748da644c86a200981 (patch)
treed15c64e70f6038121cf698b8b80b4436a0964e6d /Makefile.pre.in
parent943ca5e1d6b72830c530a72426cff094f155d010 (diff)
downloadcpython-474fdbe9e4a2ff90ef39e8748da644c86a200981.zip
cpython-474fdbe9e4a2ff90ef39e8748da644c86a200981.tar.gz
cpython-474fdbe9e4a2ff90ef39e8748da644c86a200981.tar.bz2
bpo-47152: Automatically regenerate sre_constants.h (GH-91439)
* Move the code for generating Modules/_sre/sre_constants.h from Lib/re/_constants.py into a separate script Tools/scripts/generate_sre_constants.py. * Add target `regen-sre` in the makefile. * Make target `regen-all` depending on `regen-sre`.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 22a68a7..f803391 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1197,7 +1197,7 @@ regen-limited-abi: all
# Regenerate all generated files
regen-all: regen-opcode regen-opcode-targets regen-typeslots \
- regen-token regen-ast regen-keyword regen-frozen clinic \
+ regen-token regen-ast regen-keyword regen-sre regen-frozen clinic \
regen-pegen-metaparser regen-pegen regen-test-frozenmain \
regen-global-objects
@echo
@@ -1350,6 +1350,13 @@ regen-stdlib-module-names: build_all Programs/_testembed
> $(srcdir)/Python/stdlib_module_names.h.new
$(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new
+regen-sre:
+ # Regenerate Modules/_sre/sre_constants.h from Lib/re/_constants.py
+ # using Tools/scripts/generate_sre_constants.py
+ $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_sre_constants.py \
+ $(srcdir)/Lib/re/_constants.py \
+ $(srcdir)/Modules/_sre/sre_constants.h
+
Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h
Python/getplatform.o: $(srcdir)/Python/getplatform.c