Skip to content

Commit 1777ae5

Browse files
committed
Modify Makefile to use pgen2 and remove pgen referenes
1 parent 9f8b58f commit 1777ae5

File tree

1 file changed

+5
-39
lines changed

1 file changed

+5
-39
lines changed

Makefile.pre.in

Lines changed: 5 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,18 @@ 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 \
791+
$(srcdir)/Grammar/Tokens \
813792
$(srcdir)/Include/graminit.h.new \
814793
$(srcdir)/Python/graminit.c.new
815794
$(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new
816795
$(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new
817796

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-
829797
.PHONY=regen-ast
830798
regen-ast:
831799
# Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
@@ -1015,7 +983,6 @@ PYTHON_HEADERS= \
1015983
$(srcdir)/Include/longobject.h \
1016984
$(srcdir)/Include/marshal.h \
1017985
$(srcdir)/Include/memoryobject.h \
1018-
$(srcdir)/Include/metagrammar.h \
1019986
$(srcdir)/Include/methodobject.h \
1020987
$(srcdir)/Include/modsupport.h \
1021988
$(srcdir)/Include/moduleobject.h \
@@ -1027,7 +994,6 @@ PYTHON_HEADERS= \
1027994
$(srcdir)/Include/osdefs.h \
1028995
$(srcdir)/Include/osmodule.h \
1029996
$(srcdir)/Include/patchlevel.h \
1030-
$(srcdir)/Include/pgen.h \
1031997
$(srcdir)/Include/pgenheaders.h \
1032998
$(srcdir)/Include/pyarena.h \
1033999
$(srcdir)/Include/pycapsule.h \
@@ -1768,7 +1734,7 @@ profile-removal:
17681734
rm -f profile-run-stamp
17691735

17701736
clobber: clean profile-removal
1771-
-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1737+
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
17721738
tags TAGS \
17731739
config.cache config.log pyconfig.h Modules/config.c
17741740
-rm -rf build platform

0 commit comments

Comments
 (0)