]> granicus.if.org Git - postgresql/commitdiff
Arrange to compile flex output files as inclusions into other files
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Nov 2002 22:52:34 +0000 (22:52 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Nov 2002 22:52:34 +0000 (22:52 +0000)
(usually bison output files), not as standalone files.  This hack
works around flex's insistence on including <stdio.h> 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.

17 files changed:
contrib/cube/Makefile
contrib/cube/cubeparse.y
contrib/seg/Makefile
contrib/seg/segparse.y
contrib/tsearch/Makefile
contrib/tsearch/query.c
src/backend/bootstrap/Makefile
src/backend/bootstrap/bootparse.y
src/backend/bootstrap/bootscanner.l
src/backend/parser/Makefile
src/backend/parser/gram.y
src/backend/utils/misc/Makefile
src/backend/utils/misc/guc.c
src/interfaces/ecpg/preproc/Makefile
src/interfaces/ecpg/preproc/preproc.y
src/pl/plpgsql/src/Makefile
src/pl/plpgsql/src/gram.y

index 1bf47b90e96e9ee884bf8b33d710b3f77f4d6285..0cdb317fda013cd21c4e7c949f9018a87f31fa60 100644 (file)
@@ -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
index 7810d7f1e91cea7d6677f108545b79f3a1e0d146..95bc016431dfdc0e9748b8726453341ca20a721e 100644 (file)
@@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim)
   return(bp);
 }
 
+#include "cubescan.c"
index ac9b543d83ab1a0d73b38fcf76945499387e1ed6..350e1347984ca2db5e8504ed62878121e79553ae 100644 (file)
@@ -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
index 1195198f58a545f5c46aaae8290929c1c1728b95..9e18379bc88426e0c8c9a0bc4108d2d66ca87175 100644 (file)
@@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) {
   return 0;
 }
 
-
+#include "segscan.c"
index 8241c261c0c8a34f99de62b4c68854d0d0ae56c5..ee6eeb1e841dd18cb9d99cacd33e535d9e14763f 100644 (file)
@@ -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'$@' $<
index b69151c87905b59dadb3890e22431d24fcfab7fc..9d5e126c5bcfe5ff58cc754997a531be672e6e74 100644 (file)
@@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS)
 
        PG_RETURN_POINTER(res);
 }
+
+#include "parser.c"
index b45d42b7459679af0a37156a2749c188d6d4571e..8b43344f6e9c5ae8f90402632140a28919c809d1 100644 (file)
@@ -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
index 113f11de712f719cbdfad6febfcb0b8fa804ecc2..093086614fc088f47e8a80af6b86cfeb8135fda8 100644 (file)
@@ -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"
index ac94d0001bc24fce532c0d52dfe80ba23147329b..7e5a269775ddab95f9e43446207ad3748d8e1270 100644 (file)
@@ -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 $
  *
  *-------------------------------------------------------------------------
  */
index d5d4f4372d8780b4ffc3a8e34571107418201f1d..c11098eac2ac923d25d15e3177942e3a37c030a8 100644 (file)
@@ -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
index d407fbbcd4a52adc7137c9833d0b33c9c7c15f58..32dd7b3480dc3b5e78dfc484376d13280638595c 100644 (file)
@@ -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"
index 10b759dae8e7bc07388e96de6e3f9a9e78b9b0ad..1f440a19e16f89a46710f66043bc1852f3a05f33 100644 (file)
@@ -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) $<
index c4e3f53042ba0b755fa9e422b7368b64d92c8313..48c3cdb4bf80da83b3d0902b22dd5272d76475b2 100644 (file)
@@ -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 <peter_e@gmx.net>.
@@ -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"
index 00f47f8153ef6dac94136addf6d00b5f1191c3ef..cd2f773841aa9ca54cf5242ced4400958fb716fe 100644 (file)
@@ -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
index 187239546488acb202f6f6b16081bc32d61e63f5..2c1687544e41b78ea859708b279e73d2f0fd6371 100644 (file)
@@ -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"
index 2ab565a806dd4d601c46b763cd2ae249812a8ad0..2ac216608bb1060138f5b12c0c97bbf7f2aac779 100644 (file)
@@ -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).
index 919bbd1b5e29cd245471191fb33dbcb1476c138b..d22e4aa0e44d3d249351060a4b49e2b0ff2d5663 100644 (file)
@@ -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"