1996-10-27 10:55:05 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-19 18:30:27 +02:00
|
|
|
# Makefile for parser
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/backend/parser/Makefile
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
subdir = src/backend/parser
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2010-01-05 04:56:52 +01:00
|
|
|
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
|
2002-11-01 23:52:34 +01:00
|
|
|
|
2016-03-24 01:22:08 +01:00
|
|
|
OBJS= analyze.o gram.o scan.o parser.o \
|
2011-03-20 01:29:08 +01:00
|
|
|
parse_agg.o parse_clause.o parse_coerce.o parse_collate.o parse_cte.o \
|
2018-04-12 12:22:56 +02:00
|
|
|
parse_enr.o parse_expr.o parse_func.o parse_node.o parse_oper.o \
|
2017-04-01 06:17:18 +02:00
|
|
|
parse_param.o parse_relation.o parse_target.o parse_type.o \
|
|
|
|
parse_utilcmd.o scansup.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2008-02-19 11:30:09 +01:00
|
|
|
include $(top_srcdir)/src/backend/common.mk
|
2000-07-14 17:32:04 +02:00
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
|
|
|
|
# There is no correct way to write a rule that generates two files.
|
|
|
|
# Rules with two targets don't have that meaning, they are merely
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
# shorthand for two otherwise separate rules. If we have an action
|
|
|
|
# that in fact generates two or more files, we must choose one of them
|
|
|
|
# as primary and show it as the action's output, then make all of the
|
|
|
|
# other output files dependent on the primary, like this. Furthermore,
|
|
|
|
# the "touch" action is essential, because it ensures that gram.h is
|
|
|
|
# marked as newer than (or at least no older than) gram.c. Without that,
|
|
|
|
# make is likely to try to rebuild gram.h in subsequent runs, which causes
|
|
|
|
# failures in VPATH builds from tarballs.
|
|
|
|
|
|
|
|
gram.h: gram.c
|
|
|
|
touch $@
|
2001-11-16 17:32:33 +01:00
|
|
|
|
2012-10-11 12:57:04 +02:00
|
|
|
gram.c: BISONFLAGS += -d
|
|
|
|
gram.c: BISON_CHECK_CMD = $(PERL) $(srcdir)/check_keywords.pl $< $(top_srcdir)/src/include/parser/kwlist.h
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
|
2012-10-11 12:57:04 +02:00
|
|
|
scan.c: FLEXFLAGS = -CF -p -p
|
|
|
|
scan.c: FLEX_NO_BACKUP=yes
|
2017-02-19 19:04:30 +01:00
|
|
|
scan.c: FLEX_FIX_WARNING=yes
|
2000-07-19 18:30:27 +02:00
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-05-05 00:01:03 +02:00
|
|
|
# Force these dependencies to be known even without dependency info built:
|
2016-03-24 01:22:08 +01:00
|
|
|
gram.o scan.o parser.o: gram.h
|
2000-07-19 18:30:27 +02:00
|
|
|
|
|
|
|
|
2008-08-29 15:02:33 +02:00
|
|
|
# gram.c, gram.h, and scan.c are in the distribution tarball, so they
|
2000-07-19 18:30:27 +02:00
|
|
|
# are not cleaned here.
|
2011-08-25 20:44:17 +02:00
|
|
|
clean distclean maintainer-clean:
|
|
|
|
rm -f lex.backup
|