]> granicus.if.org Git - postgresql/blob - src/backend/parser/Makefile
Build backend/parser/scan.l and interfaces/ecpg/preproc/pgc.l standalone.
[postgresql] / src / backend / parser / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for parser
4 #
5 # src/backend/parser/Makefile
6 #
7 #-------------------------------------------------------------------------
8
9 subdir = src/backend/parser
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
12
13 override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
14
15 OBJS= analyze.o gram.o scan.o keywords.o kwlookup.o parser.o \
16       parse_agg.o parse_clause.o parse_coerce.o parse_collate.o parse_cte.o \
17       parse_expr.o parse_func.o parse_node.o parse_oper.o parse_param.o \
18       parse_relation.o parse_target.o parse_type.o parse_utilcmd.o scansup.o
19
20 include $(top_srcdir)/src/backend/common.mk
21
22
23 # Latest flex causes warnings in this file.
24 ifeq ($(GCC),yes)
25 scan.o: CFLAGS += -Wno-error
26 endif
27
28
29 # There is no correct way to write a rule that generates two files.
30 # Rules with two targets don't have that meaning, they are merely
31 # shorthand for two otherwise separate rules.  To be safe for parallel
32 # make, we must chain the dependencies like this.  The semicolon is
33 # important, otherwise make will choose the built-in rule for
34 # gram.y=>gram.c.
35
36 gram.h: gram.c ;
37
38 gram.c: BISONFLAGS += -d
39 gram.c: BISON_CHECK_CMD = $(PERL) $(srcdir)/check_keywords.pl $< $(top_srcdir)/src/include/parser/kwlist.h
40
41
42 scan.c: FLEXFLAGS = -CF -p -p
43 scan.c: FLEX_NO_BACKUP=yes
44
45
46 # Force these dependencies to be known even without dependency info built:
47 gram.o scan.o keywords.o parser.o: gram.h
48
49
50 # gram.c, gram.h, and scan.c are in the distribution tarball, so they
51 # are not cleaned here.
52 clean distclean maintainer-clean:
53         rm -f lex.backup