1996-10-27 10:55:05 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-19 18:30:27 +02:00
|
|
|
# Makefile for parser
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
2003-02-10 05:44:47 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.40 2003/02/10 04:44:45 tgl Exp $
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
subdir = src/backend/parser
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2002-11-01 23:52:34 +01:00
|
|
|
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
|
|
|
|
|
1997-11-25 23:07:18 +01:00
|
|
|
OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \
|
|
|
|
parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
|
2002-11-01 23:52:34 +01:00
|
|
|
parse_type.o parse_coerce.o parse_target.o scansup.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2002-04-20 23:56:15 +02:00
|
|
|
FLEXFLAGS = -CF
|
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
all: SUBSYS.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
SUBSYS.o: $(OBJS)
|
|
|
|
$(LD) $(LDREL) $(LDOUT) $@ $^
|
2000-07-14 17:32:04 +02:00
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
|
2002-11-01 23:52:34 +01:00
|
|
|
# scan is compiled as part of gram
|
|
|
|
gram.o: $(srcdir)/scan.c
|
|
|
|
|
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
# 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 ;
|
|
|
|
|
2003-01-31 21:58:00 +01:00
|
|
|
# The sed hack is so that we can get the same error messages with
|
|
|
|
# bison 1.875 and later as we did with earlier bisons. Eventually,
|
|
|
|
# I suppose, we should re-standardize on "syntax error" --- in which
|
|
|
|
# case flip the sed translation, but don't remove it.
|
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
$(srcdir)/parse.h: gram.y
|
2001-02-10 23:31:42 +01:00
|
|
|
ifdef YACC
|
2000-06-07 18:27:00 +02:00
|
|
|
$(YACC) -d $(YFLAGS) $<
|
2003-01-31 21:58:00 +01:00
|
|
|
sed -e 's/"syntax error/"parse error/' < y.tab.c > $(srcdir)/gram.c
|
2001-11-16 17:32:33 +01:00
|
|
|
mv -f y.tab.h $(srcdir)/parse.h
|
2003-01-31 21:58:00 +01:00
|
|
|
rm -f y.tab.c
|
2001-02-10 23:31:42 +01:00
|
|
|
else
|
|
|
|
@$(missing) bison $< $@
|
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
$(srcdir)/scan.c: scan.l
|
2000-08-28 13:53:23 +02:00
|
|
|
ifdef FLEX
|
2002-04-20 23:56:15 +02:00
|
|
|
$(FLEX) $(FLEXFLAGS) -o'$@' $<
|
2000-08-28 13:53:23 +02:00
|
|
|
else
|
|
|
|
@$(missing) flex $< $@
|
|
|
|
endif
|
2000-07-19 18:30:27 +02:00
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-05-05 00:01:03 +02:00
|
|
|
# Force these dependencies to be known even without dependency info built:
|
|
|
|
|
2003-02-10 05:44:47 +01:00
|
|
|
gram.o keywords.o parser.o: $(srcdir)/parse.h
|
2000-07-19 18:30:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
# gram.c, parse.h, and scan.c are in the distribution tarball, so they
|
|
|
|
# are not cleaned here.
|
|
|
|
clean:
|
|
|
|
rm -f SUBSYS.o $(OBJS)
|
|
|
|
# And the garbage that might have been left behind by partial build:
|
|
|
|
@rm -f y.tab.c y.tab.h lex.yy.c
|