From: Tom Lane Date: Fri, 1 Nov 2002 22:52:34 +0000 (+0000) Subject: Arrange to compile flex output files as inclusions into other files X-Git-Tag: REL7_3~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cab9437a43db6b233e2308aeb71a0b3bac600410;p=postgresql Arrange to compile flex output files as inclusions into other files (usually bison output files), not as standalone files. This hack works around flex's insistence on including before we are able to include postgres.h; postgres.h will already be read before the compiler starts to read the flex output file. Needed for largefile support on some platforms. --- diff --git a/contrib/cube/Makefile b/contrib/cube/Makefile index 1bf47b90e9..0cdb317fda 100644 --- a/contrib/cube/Makefile +++ b/contrib/cube/Makefile @@ -1,17 +1,20 @@ -# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $ subdir = contrib/cube top_builddir = ../.. include $(top_builddir)/src/Makefile.global MODULE_big = cube -OBJS= cube.o cubeparse.o cubescan.o buffer.o +OBJS= cube.o cubeparse.o buffer.o DATA_built = cube.sql DOCS = README.cube REGRESS = cube +# cubescan is compiled as part of cubeparse +cubeparse.o: cubescan.c + cubeparse.c: cubeparse.h ; cubeparse.h: cubeparse.y diff --git a/contrib/cube/cubeparse.y b/contrib/cube/cubeparse.y index 7810d7f1e9..95bc016431 100644 --- a/contrib/cube/cubeparse.y +++ b/contrib/cube/cubeparse.y @@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim) return(bp); } +#include "cubescan.c" diff --git a/contrib/seg/Makefile b/contrib/seg/Makefile index ac9b543d83..350e134798 100644 --- a/contrib/seg/Makefile +++ b/contrib/seg/Makefile @@ -1,16 +1,19 @@ -# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $ +# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $ subdir = contrib/seg top_builddir = ../.. include $(top_builddir)/src/Makefile.global MODULE_big = seg -OBJS = seg.o segparse.o segscan.o buffer.o +OBJS = seg.o segparse.o buffer.o DATA_built = seg.sql DOCS = README.seg REGRESS = seg +# segscan is compiled as part of segparse +segparse.o: segscan.c + segparse.c: segparse.h ; segparse.h: segparse.y diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y index 1195198f58..9e18379bc8 100644 --- a/contrib/seg/segparse.y +++ b/contrib/seg/segparse.y @@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) { return 0; } - +#include "segscan.c" diff --git a/contrib/tsearch/Makefile b/contrib/tsearch/Makefile index 8241c261c0..ee6eeb1e84 100644 --- a/contrib/tsearch/Makefile +++ b/contrib/tsearch/Makefile @@ -1,16 +1,19 @@ -# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.1 2001/10/12 23:19:09 tgl Exp $ +# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.2 2002/11/01 22:52:33 tgl Exp $ subdir = contrib/tsearch top_builddir = ../.. include $(top_builddir)/src/Makefile.global MODULE_big = tsearch -OBJS = parser.o crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o +OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o DATA_built = tsearch.sql DOCS = README.tsearch REGRESS = tsearch +# parser is compiled as part of query +query.o: parser.c + parser.c: parser.l ifdef FLEX $(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $< diff --git a/contrib/tsearch/query.c b/contrib/tsearch/query.c index b69151c879..9d5e126c5b 100644 --- a/contrib/tsearch/query.c +++ b/contrib/tsearch/query.c @@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS) PG_RETURN_POINTER(res); } + +#include "parser.c" diff --git a/src/backend/bootstrap/Makefile b/src/backend/bootstrap/Makefile index b45d42b745..8b43344f6e 100644 --- a/src/backend/bootstrap/Makefile +++ b/src/backend/bootstrap/Makefile @@ -2,7 +2,7 @@ # # Makefile for the bootstrap module # -# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.30 2002/01/09 00:06:42 tgl Exp $ +# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.31 2002/11/01 22:52:33 tgl Exp $ # #------------------------------------------------------------------------- @@ -14,9 +14,9 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) # qnx4's wlink currently crashes with bootstrap.o ifneq ($(PORTNAME), qnx4) -OBJS= bootparse.o bootscanner.o bootstrap.o +OBJS= bootparse.o bootstrap.o else -OBJS= bootparse.o bootscanner.o +OBJS= bootparse.o endif @@ -27,8 +27,10 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) $@ $^ -bootstrap.o bootscanner.o: $(srcdir)/bootstrap_tokens.h +bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h +# bootscanner is compiled as part of bootparse +bootparse.o: $(srcdir)/bootscanner.c # `sed' rules to remove conflicts between bootstrap scanner and parser # and the SQL scanner and parser. For correctness' sake the rules that diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y index 113f11de71..093086614f 100644 --- a/src/backend/bootstrap/bootparse.y +++ b/src/backend/bootstrap/bootparse.y @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.52 2002/09/02 01:05:03 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.53 2002/11/01 22:52:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -335,3 +335,5 @@ boot_ident : ID { $$=yylval.ival; } ; %% + +#include "bootscanner.c" diff --git a/src/backend/bootstrap/bootscanner.l b/src/backend/bootstrap/bootscanner.l index ac94d0001b..7e5a269775 100644 --- a/src/backend/bootstrap/bootscanner.l +++ b/src/backend/bootstrap/bootscanner.l @@ -1,7 +1,7 @@ %{ /*------------------------------------------------------------------------- * - * bootscanner.lex + * bootscanner.l * a lexical scanner for the bootstrap parser * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.25 2002/07/30 16:33:08 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.26 2002/11/01 22:52:33 tgl Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/parser/Makefile b/src/backend/parser/Makefile index d5d4f4372d..c11098eac2 100644 --- a/src/backend/parser/Makefile +++ b/src/backend/parser/Makefile @@ -2,7 +2,7 @@ # # Makefile for parser # -# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.37 2002/04/20 21:56:14 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.38 2002/11/01 22:52:33 tgl Exp $ # #------------------------------------------------------------------------- @@ -10,9 +10,11 @@ subdir = src/backend/parser top_builddir = ../../.. include $(top_builddir)/src/Makefile.global +override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) + OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \ parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \ - parse_type.o parse_coerce.o parse_target.o scan.o scansup.o + parse_type.o parse_coerce.o parse_target.o scansup.o FLEXFLAGS = -CF @@ -23,6 +25,10 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) $@ $^ +# scan is compiled as part of gram +gram.o: $(srcdir)/scan.c + + # 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 # shorthand for two otherwise separate rules. To be safe for parallel @@ -52,7 +58,7 @@ endif # Force these dependencies to be known even without dependency info built: -keywords.o parse_clause.o parse_expr.o parser.o scan.o: $(srcdir)/parse.h +keywords.o parse_clause.o parse_expr.o parser.o gram.o: $(srcdir)/parse.h # gram.c, parse.h, and scan.c are in the distribution tarball, so they diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index d407fbbcd4..32dd7b3480 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.371 2002/10/31 02:31:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.372 2002/11/01 22:52:33 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -7777,3 +7777,5 @@ doNegateFloat(Value *v) v->val.str = newval; } } + +#include "scan.c" diff --git a/src/backend/utils/misc/Makefile b/src/backend/utils/misc/Makefile index 10b759dae8..1f440a19e1 100644 --- a/src/backend/utils/misc/Makefile +++ b/src/backend/utils/misc/Makefile @@ -1,10 +1,12 @@ -# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.19 2000/10/20 21:03:55 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.20 2002/11/01 22:52:33 tgl Exp $ subdir = src/backend/utils/misc top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global -OBJS = database.o superuser.o guc.o guc-file.o ps_status.o +override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) + +OBJS = database.o superuser.o guc.o ps_status.o # This location might depend on the installation directories. Therefore # we can't subsitute it into config.h. @@ -18,6 +20,9 @@ all: SUBSYS.o SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) +# guc-file is compiled as part of guc +guc.o: $(srcdir)/guc-file.c + $(srcdir)/guc-file.c: guc-file.l ifdef FLEX $(FLEX) $(FLEXFLAGS) $< diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index c4e3f53042..48c3cdb4bf 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -5,7 +5,7 @@ * command, configuration file, and command line options. * See src/backend/utils/misc/README for more information. * - * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.98 2002/10/31 21:34:17 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.99 2002/11/01 22:52:33 tgl Exp $ * * Copyright 2000 by PostgreSQL Global Development Group * Written by Peter Eisentraut . @@ -3014,3 +3014,5 @@ assign_msglvl(int *var, const char *newval, bool doit, bool interactive) return NULL; /* fail */ return newval; /* OK */ } + +#include "guc-file.c" diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 00f47f8153..cd2f773841 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.87 2002/10/21 18:05:24 petere Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.88 2002/11/01 22:52:33 tgl Exp $ subdir = src/interfaces/ecpg/preproc top_builddir = ../../../.. @@ -17,7 +17,7 @@ ifeq ($(GCC), yes) override CFLAGS += -Wno-error endif -OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\ +OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\ keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o @@ -26,6 +26,9 @@ all: submake-libpgport ecpg ecpg: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ +# pgc is compiled as part of preproc +preproc.o: $(srcdir)/pgc.c + $(srcdir)/preproc.c: $(srcdir)/preproc.h ; $(srcdir)/preproc.h: preproc.y @@ -44,7 +47,7 @@ else @$(missing) flex $< $@ endif -c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h +c_keywords.o ecpg_keywords.o keywords.o preproc.o: preproc.h distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 1872395464..2c1687544e 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.199 2002/10/21 13:09:31 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.200 2002/11/01 22:52:33 tgl Exp $ */ /* Copyright comment */ %{ @@ -5567,3 +5567,5 @@ void yyerror( char * error) buf[sizeof(buf)-1]=0; mmerror(PARSE_ERROR, ET_ERROR, buf); } + +#include "pgc.c" diff --git a/src/pl/plpgsql/src/Makefile b/src/pl/plpgsql/src/Makefile index 2ab565a806..2ac216608b 100644 --- a/src/pl/plpgsql/src/Makefile +++ b/src/pl/plpgsql/src/Makefile @@ -2,7 +2,7 @@ # # Makefile for the plpgsql shared object # -# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.22 2002/09/05 18:28:46 petere Exp $ +# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.23 2002/11/01 22:52:34 tgl Exp $ # #------------------------------------------------------------------------- @@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) SHLIB_LINK = $(BE_DLLLIBS) rpath := -OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o +OBJS = pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o ifneq ($(PORTNAME), qnx4) all: all-lib @@ -59,7 +59,10 @@ installdirs: uninstall: rm -f $(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX) -pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h +pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h + +# pl_scan is compiled as part of pl_gram +pl_gram.o: $(srcdir)/pl_scan.c # Note: Since the yacc and lex files are shipped in the distribution, # they must be generated in the srcdir (as opposed to builddir). diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index 919bbd1b5e..d22e4aa0e4 100644 --- a/src/pl/plpgsql/src/gram.y +++ b/src/pl/plpgsql/src/gram.y @@ -4,7 +4,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.38 2002/09/22 21:56:47 tgl Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.39 2002/11/01 22:52:34 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -1997,3 +1997,5 @@ check_assignable(PLpgSQL_datum *datum) break; } } + +#include "pl_scan.c"