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
|
|
|
#
|
2002-04-20 23:56:15 +02:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.37 2002/04/20 21:56:14 petere 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
|
|
|
|
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 \
|
1998-05-10 01:24:27 +02:00
|
|
|
parse_type.o parse_coerce.o parse_target.o scan.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
|
|
|
|
|
|
|
# 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
|
2001-02-10 23:31:42 +01:00
|
|
|
ifdef YACC
|
2000-06-07 18:27:00 +02:00
|
|
|
$(YACC) -d $(YFLAGS) $<
|
2001-11-16 17:32:33 +01:00
|
|
|
mv -f y.tab.c $(srcdir)/gram.c
|
|
|
|
mv -f y.tab.h $(srcdir)/parse.h
|
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:
|
|
|
|
|
2002-03-08 08:12:11 +01:00
|
|
|
keywords.o parse_clause.o parse_expr.o parser.o scan.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
|