summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-03-23 19:47:40 (GMT)
committerGitHub <noreply@github.com>2021-03-23 19:47:40 (GMT)
commit94faa0724f8cbae6867c491c8e465e35f4fdbfbb (patch)
tree05590930e5ffbdc1e01be0aaf505d74cf3c49136 /Makefile.pre.in
parentcd27af70d58161c59072e27a10e0e63dcbf0bccb (diff)
downloadcpython-94faa0724f8cbae6867c491c8e465e35f4fdbfbb.zip
cpython-94faa0724f8cbae6867c491c8e465e35f4fdbfbb.tar.gz
cpython-94faa0724f8cbae6867c491c8e465e35f4fdbfbb.tar.bz2
bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933)
These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows <winbase.h> header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 6655eda..552ee95 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -849,16 +849,19 @@ regen-pegen:
.PHONY=regen-ast
regen-ast:
- # Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py
+ # Regenerate 3 files using using Parser/asdl_c.py:
+ # - Include/internal/pycore_ast.h
+ # - Include/internal/pycore_ast_state.h
+ # - Python/Python-ast.c
$(MKDIR_P) $(srcdir)/Include
$(MKDIR_P) $(srcdir)/Python
$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
$(srcdir)/Parser/Python.asdl \
- -H $(srcdir)/Include/Python-ast.h.new \
+ -H $(srcdir)/Include/internal/pycore_ast.h.new \
-I $(srcdir)/Include/internal/pycore_ast_state.h.new \
-C $(srcdir)/Python/Python-ast.c.new
- $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new
$(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
@@ -922,7 +925,7 @@ 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
-Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/Python-ast.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
$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
@@ -1020,8 +1023,6 @@ regen-typeslots:
PYTHON_HEADERS= \
$(srcdir)/Include/Python.h \
$(srcdir)/Include/abstract.h \
- $(srcdir)/Include/asdl.h \
- $(srcdir)/Include/ast.h \
$(srcdir)/Include/bltinmodule.h \
$(srcdir)/Include/boolobject.h \
$(srcdir)/Include/bytearrayobject.h \
@@ -1098,7 +1099,6 @@ PYTHON_HEADERS= \
\
pyconfig.h \
$(PARSER_HEADERS) \
- $(srcdir)/Include/Python-ast.h \
\
$(srcdir)/Include/cpython/abstract.h \
$(srcdir)/Include/cpython/bytearrayobject.h \
@@ -1136,6 +1136,7 @@ PYTHON_HEADERS= \
\
$(srcdir)/Include/internal/pycore_abstract.h \
$(srcdir)/Include/internal/pycore_accu.h \
+ $(srcdir)/Include/internal/pycore_asdl.h \
$(srcdir)/Include/internal/pycore_ast.h \
$(srcdir)/Include/internal/pycore_ast_state.h \
$(srcdir)/Include/internal/pycore_atomic.h \