| 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 = \ |
| 16 |
analyze.o \ |
| 17 |
gram.o \ |
| 18 |
parse_agg.o \ |
| 19 |
parse_clause.o \ |
| 20 |
parse_coerce.o \ |
| 21 |
parse_collate.o \ |
| 22 |
parse_cte.o \ |
| 23 |
parse_enr.o \ |
| 24 |
parse_expr.o \ |
| 25 |
parse_func.o \ |
| 26 |
parse_jsontable.o \ |
| 27 |
parse_merge.o \ |
| 28 |
parse_node.o \ |
| 29 |
parse_oper.o \ |
| 30 |
parse_param.o \ |
| 31 |
parse_relation.o \ |
| 32 |
parse_target.o \ |
| 33 |
parse_type.o \ |
| 34 |
parse_utilcmd.o \ |
| 35 |
parser.o \ |
| 36 |
scan.o \ |
| 37 |
scansup.o |
| 38 |
|
| 39 |
include $(top_srcdir)/src/backend/common.mk |
| 40 |
|
| 41 |
|
| 42 |
# There is no correct way to write a rule that generates two files. |
| 43 |
# Rules with two targets don't have that meaning, they are merely |
| 44 |
# shorthand for two otherwise separate rules. If we have an action |
| 45 |
# that in fact generates two or more files, we must choose one of them |
| 46 |
# as primary and show it as the action's output, then make all of the |
| 47 |
# other output files dependent on the primary, like this. Furthermore, |
| 48 |
# the "touch" action is essential, because it ensures that gram.h is |
| 49 |
# marked as newer than (or at least no older than) gram.c. Without that, |
| 50 |
# make is likely to try to rebuild gram.h in subsequent runs, which causes |
| 51 |
# failures in VPATH builds from tarballs. |
| 52 |
|
| 53 |
gram.h: gram.c |
| 54 |
touch $@ |
| 55 |
|
| 56 |
gram.c: BISONFLAGS += -d |
| 57 |
gram.c: BISON_CHECK_CMD = $(PERL) $(srcdir)/check_keywords.pl $< $(top_srcdir)/src/include/parser/kwlist.h |
| 58 |
|
| 59 |
|
| 60 |
scan.c: FLEXFLAGS = -CF -p -p |
| 61 |
scan.c: FLEX_NO_BACKUP=yes |
| 62 |
|
| 63 |
|
| 64 |
# Force these dependencies to be known even without dependency info built: |
| 65 |
gram.o scan.o parser.o: gram.h |
| 66 |
|
| 67 |
clean: |
| 68 |
rm -f gram.c \ |
| 69 |
gram.h \ |
| 70 |
scan.c |
| 71 |
rm -f lex.backup |