mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Make the yacc rules safe for parallel make. See discussion on pgsql-patches
and comment in src/backend/parser/Makefile for the technical details.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Makefile for the bootstrap module
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.28 2001/08/22 20:02:56 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.29 2001/11/16 16:32:33 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@ SUBSYS.o: $(OBJS)
|
||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||
|
||||
|
||||
bootstrap.o bootscanner.c: $(srcdir)/bootstrap_tokens.h
|
||||
bootstrap.o bootscanner.o: $(srcdir)/bootstrap_tokens.h
|
||||
|
||||
|
||||
# `sed' rules to remove conflicts between bootstrap scanner and parser
|
||||
@@ -37,7 +37,9 @@ sed -e 's/^yy/Int_yy/g' \
|
||||
endef
|
||||
|
||||
|
||||
$(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
|
||||
$(srcdir)/bootparse.c: $(srcdir)/bootstrap_tokens.h ;
|
||||
|
||||
$(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
|
||||
ifdef YACC
|
||||
$(YACC) -d $(YFLAGS) $<
|
||||
$(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Makefile for parser
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.34 2001/08/09 18:13:23 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.35 2001/11/16 16:32:33 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -20,15 +20,26 @@ all: SUBSYS.o
|
||||
SUBSYS.o: $(OBJS)
|
||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||
|
||||
$(srcdir)/gram.c $(srcdir)/parse.h: gram.y
|
||||
|
||||
# There is no correct way to write a rule that generates two files.
|
||||
# Rules with two targets don't have that meaning, they are merely
|
||||
# shorthand for two otherwise separate rules. To be safe for parallel
|
||||
# make, we must chain the dependencies like this. The semicolon is
|
||||
# important, otherwise make will choose the built-in rule for
|
||||
# gram.y=>gram.c.
|
||||
|
||||
$(srcdir)/gram.c: $(srcdir)/parse.h ;
|
||||
|
||||
$(srcdir)/parse.h: gram.y
|
||||
ifdef YACC
|
||||
$(YACC) -d $(YFLAGS) $<
|
||||
mv y.tab.c $(srcdir)/gram.c
|
||||
mv y.tab.h $(srcdir)/parse.h
|
||||
mv -f y.tab.c $(srcdir)/gram.c
|
||||
mv -f y.tab.h $(srcdir)/parse.h
|
||||
else
|
||||
@$(missing) bison $< $@
|
||||
endif
|
||||
|
||||
|
||||
$(srcdir)/scan.c: scan.l
|
||||
ifdef FLEX
|
||||
$(FLEX) $(FLEXFLAGS) -Pbase_yy -o'$@' $<
|
||||
|
Reference in New Issue
Block a user