Skip to content

Commit 94d3fd0

Browse files
committed
Modify Makefile to use pgen2 and remove pgen referenes
1 parent b27230a commit 94d3fd0

File tree

1 file changed

+4
-39
lines changed

1 file changed

+4
-39
lines changed

Makefile.pre.in

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -290,40 +290,21 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
290290

291291
##########################################################################
292292
# Parser
293-
PGEN= Parser/pgen$(EXE)
294-
295293
POBJS= \
296294
Parser/acceler.o \
297295
Parser/grammar1.o \
298296
Parser/listnode.o \
299297
Parser/node.o \
300298
Parser/parser.o \
301-
Parser/bitset.o \
302-
Parser/metagrammar.o \
303-
Parser/firstsets.o \
304-
Parser/grammar.o \
305299
Parser/token.o \
306-
Parser/pgen.o
307300

308301
PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o
309302

310-
PGOBJS= \
311-
Objects/obmalloc.o \
312-
Python/dynamic_annotations.o \
313-
Python/mysnprintf.o \
314-
Python/pyctype.o \
315-
Parser/tokenizer_pgen.o \
316-
Parser/printgrammar.o \
317-
Parser/parsetok_pgen.o \
318-
Parser/pgenmain.o
319-
320303
PARSER_HEADERS= \
321304
$(srcdir)/Parser/parser.h \
322305
$(srcdir)/Include/parsetok.h \
323306
$(srcdir)/Parser/tokenizer.h
324307

325-
PGENOBJS= $(POBJS) $(PGOBJS)
326-
327308
##########################################################################
328309
# Python
329310

@@ -801,31 +782,17 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
801782

802783
$(IO_OBJS): $(IO_H)
803784

804-
$(PGEN): $(PGENOBJS)
805-
$(CC) $(OPT) $(PY_CORE_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
806-
807785
.PHONY: regen-grammar
808-
regen-grammar: $(PGEN)
786+
regen-grammar:
809787
# Regenerate Include/graminit.h and Python/graminit.c
810-
# from Grammar/Grammar using pgen
788+
# from Grammar/Grammar using pgen2
811789
@$(MKDIR_P) Include
812-
$(PGEN) $(srcdir)/Grammar/Grammar \
790+
$(PYTHON_FOR_REGEN) -m Parser.pgen $(srcdir)/Grammar/Grammar \
813791
$(srcdir)/Include/graminit.h.new \
814792
$(srcdir)/Python/graminit.c.new
815793
$(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new
816794
$(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new
817795

818-
Parser/grammar.o: $(srcdir)/Parser/grammar.c \
819-
$(srcdir)/Include/token.h \
820-
$(srcdir)/Include/grammar.h
821-
Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
822-
823-
Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
824-
Parser/parsetok_pgen.o: $(srcdir)/Parser/parsetok.c
825-
Parser/printgrammar.o: $(srcdir)/Parser/printgrammar.c
826-
827-
Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
828-
829796
.PHONY=regen-ast
830797
regen-ast:
831798
# Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
@@ -1015,7 +982,6 @@ PYTHON_HEADERS= \
1015982
$(srcdir)/Include/longobject.h \
1016983
$(srcdir)/Include/marshal.h \
1017984
$(srcdir)/Include/memoryobject.h \
1018-
$(srcdir)/Include/metagrammar.h \
1019985
$(srcdir)/Include/methodobject.h \
1020986
$(srcdir)/Include/modsupport.h \
1021987
$(srcdir)/Include/moduleobject.h \
@@ -1027,7 +993,6 @@ PYTHON_HEADERS= \
1027993
$(srcdir)/Include/osdefs.h \
1028994
$(srcdir)/Include/osmodule.h \
1029995
$(srcdir)/Include/patchlevel.h \
1030-
$(srcdir)/Include/pgen.h \
1031996
$(srcdir)/Include/pgenheaders.h \
1032997
$(srcdir)/Include/pyarena.h \
1033998
$(srcdir)/Include/pycapsule.h \
@@ -1768,7 +1733,7 @@ profile-removal:
17681733
rm -f profile-run-stamp
17691734

17701735
clobber: clean profile-removal
1771-
-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1736+
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
17721737
tags TAGS \
17731738
config.cache config.log pyconfig.h Modules/config.c
17741739
-rm -rf build platform

0 commit comments

Comments
 (0)