1 #-------------------------------------------------------------------------
7 #-------------------------------------------------------------------------
9 subdir
= src
/backend
/parser
10 top_builddir
= ..
/..
/..
11 include $(top_builddir
)/src
/Makefile.global
13 override CPPFLAGS
:= -I
$(srcdir) $(CPPFLAGS
)
15 OBJS
= analyze.o gram.o keywords.o parser.o parse_agg.o parse_cte.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 parse_utilcmd.o scansup.o
21 include $(top_srcdir
)/src
/backend
/common.mk
24 # scan is compiled as part of gram
25 gram.o
: $(srcdir)/scan.c
28 # There is no correct way to write a rule that generates two files.
29 # Rules with two targets don't have that meaning, they are merely
30 # shorthand for two otherwise separate rules. To be safe for parallel
31 # make, we must chain the dependencies like this. The semicolon is
32 # important, otherwise make will choose the built-in rule for
35 $(srcdir)/gram.h
: $(srcdir)/gram.c
;
37 $(srcdir)/gram.c
: gram.y
39 $(BISON
) -d
$(BISONFLAGS
) -o
$@
$<
41 @
$(missing
) bison
$< $@
45 $(srcdir)/scan.c
: scan.l
47 $(FLEX
) $(FLEXFLAGS
) -o
'$@' $<
49 @
$(missing
) flex
$< $@
53 # Force these dependencies to be known even without dependency info built:
54 gram.o keywords.o parser.o
: $(srcdir)/gram.h
57 # gram.c, gram.h, and scan.c are in the distribution tarball, so they
58 # are not cleaned here.