OSDN Git Service

9e58d83dfe4f1a487d64c032f156b1935b8a182b
[pg-rex/syncrep.git] / src / backend / parser / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for parser
4 #
5 # $PostgreSQL: pgsql/src/backend/parser/Makefile,v 1.52 2009/10/31 01:41:31 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 kwlookup.o parser.o \
16       parse_agg.o parse_clause.o parse_coerce.o parse_cte.o parse_expr.o \
17       parse_func.o parse_node.o parse_oper.o parse_param.o parse_relation.o \
18       parse_target.o parse_type.o parse_utilcmd.o scansup.o
19
20 FLEXFLAGS = -CF
21
22 include $(top_srcdir)/src/backend/common.mk
23
24
25 # scan is compiled as part of gram
26 gram.o: scan.c
27
28 # Latest flex causes warnings in this file.
29 ifeq ($(GCC),yes)
30 gram.o: CFLAGS += -Wno-error
31 endif
32
33
34 # There is no correct way to write a rule that generates two files.
35 # Rules with two targets don't have that meaning, they are merely
36 # shorthand for two otherwise separate rules.  To be safe for parallel
37 # make, we must chain the dependencies like this.  The semicolon is
38 # important, otherwise make will choose the built-in rule for
39 # gram.y=>gram.c.
40
41 gram.h: gram.c ;
42
43 gram.c: gram.y
44 ifdef BISON
45         $(BISON) -d $(BISONFLAGS) -o $@ $<
46 else
47         @$(missing) bison $< $@
48 endif
49
50
51 scan.c: scan.l
52 ifdef FLEX
53         $(FLEX) $(FLEXFLAGS) -o'$@' $<
54 else
55         @$(missing) flex $< $@
56 endif
57
58
59 # Force these dependencies to be known even without dependency info built:
60 gram.o keywords.o parser.o: gram.h
61
62
63 # gram.c, gram.h, and scan.c are in the distribution tarball, so they
64 # are not cleaned here.