summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2012-03-15 17:08:34 (GMT)
committerMatthias Klose <doko@ubuntu.com>2012-03-15 17:08:34 (GMT)
commit93a0ef16c939581fb366897d2f07c395601f8ddf (patch)
treed7d4f64ed1af9a152dd341692dcb8353e4fecd71 /Makefile.pre.in
parenta4e018889ac3537e10b48811b4be6356e633b8a0 (diff)
downloadcpython-93a0ef16c939581fb366897d2f07c395601f8ddf.zip
cpython-93a0ef16c939581fb366897d2f07c395601f8ddf.tar.gz
cpython-93a0ef16c939581fb366897d2f07c395601f8ddf.tar.bz2
- Issue #14321: Do not run pgen during the build if files are up to date.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in38
1 files changed, 32 insertions, 6 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 31efeca..1321162 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -58,6 +58,8 @@ INSTALL_DATA= @INSTALL_DATA@
# Also, making them read-only seems to be a good idea...
INSTALL_SHARED= ${INSTALL} -m 555
+MKDIR_P= @MKDIR_P@
+
MAKESETUP= $(srcdir)/Modules/makesetup
# Compiler options
@@ -233,6 +235,18 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
# Parser
PGEN= Parser/pgen$(EXE)
+PSRCS= \
+ Parser/acceler.c \
+ Parser/grammar1.c \
+ Parser/listnode.c \
+ Parser/node.c \
+ Parser/parser.c \
+ Parser/bitset.c \
+ Parser/metagrammar.c \
+ Parser/firstsets.c \
+ Parser/grammar.c \
+ Parser/pgen.c
+
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -247,6 +261,16 @@ POBJS= \
PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o
+PGSRCS= \
+ Objects/obmalloc.c \
+ Python/dynamic_annotations.c \
+ Python/mysnprintf.c \
+ Python/pyctype.c \
+ Parser/tokenizer_pgen.c \
+ Parser/printgrammar.c \
+ Parser/parsetok_pgen.c \
+ Parser/pgenmain.c
+
PGOBJS= \
Objects/obmalloc.o \
Python/dynamic_annotations.o \
@@ -262,7 +286,8 @@ PARSER_HEADERS= \
$(srcdir)/Include/parsetok.h \
$(srcdir)/Parser/tokenizer.h
-PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
+PGENSRCS= $(PSRCS) $(PGSRCS)
+PGENOBJS= $(POBJS) $(PGOBJS)
##########################################################################
# AST
@@ -591,12 +616,13 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
$(IO_OBJS): $(IO_H)
-# Use a stamp file to prevent make -j invoking pgen twice
-$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
-Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
- -@$(INSTALL) -d Include
+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+ @$(MKDIR_P) Include
+ $(MAKE) $(PGEN)
$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- -touch Parser/pgen.stamp
+$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+ $(MAKE) $(GRAMMAR_H)
+ touch $(GRAMMAR_C)
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)