]> granicus.if.org Git - postgresql/blob - src/backend/parser/Makefile
Implement feature of new FE/BE protocol whereby RowDescription identifies
[postgresql] / src / backend / parser / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for parser
4 #
5 # $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.40 2003/02/10 04:44:45 tgl Exp $
6 #
7 #-------------------------------------------------------------------------
8
9 subdir = src/backend/parser
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
12
13 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
14
15 OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \
16       parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
17       parse_type.o parse_coerce.o parse_target.o scansup.o
18
19 FLEXFLAGS = -CF
20
21
22 all: SUBSYS.o
23
24 SUBSYS.o: $(OBJS)
25         $(LD) $(LDREL) $(LDOUT) $@ $^
26
27
28 # scan is compiled as part of gram
29 gram.o: $(srcdir)/scan.c
30
31
32 # There is no correct way to write a rule that generates two files.
33 # Rules with two targets don't have that meaning, they are merely
34 # shorthand for two otherwise separate rules.  To be safe for parallel
35 # make, we must chain the dependencies like this.  The semicolon is
36 # important, otherwise make will choose the built-in rule for
37 # gram.y=>gram.c.
38
39 $(srcdir)/gram.c: $(srcdir)/parse.h ;
40
41 # The sed hack is so that we can get the same error messages with
42 # bison 1.875 and later as we did with earlier bisons.  Eventually,
43 # I suppose, we should re-standardize on "syntax error" --- in which
44 # case flip the sed translation, but don't remove it.
45
46 $(srcdir)/parse.h: gram.y
47 ifdef YACC
48         $(YACC) -d $(YFLAGS) $<
49         sed -e 's/"syntax error/"parse error/' < y.tab.c > $(srcdir)/gram.c
50         mv -f y.tab.h $(srcdir)/parse.h
51         rm -f y.tab.c
52 else
53         @$(missing) bison $< $@
54 endif
55
56
57 $(srcdir)/scan.c: scan.l
58 ifdef FLEX
59         $(FLEX) $(FLEXFLAGS) -o'$@' $<
60 else
61         @$(missing) flex $< $@
62 endif
63
64
65 # Force these dependencies to be known even without dependency info built:
66
67 gram.o keywords.o parser.o: $(srcdir)/parse.h
68
69
70 # gram.c, parse.h, and scan.c are in the distribution tarball, so they
71 # are not cleaned here.
72 clean: 
73         rm -f SUBSYS.o $(OBJS)
74 # And the garbage that might have been left behind by partial build:
75         @rm -f y.tab.c y.tab.h lex.yy.c