Commit cab9437a authored by Tom Lane's avatar Tom Lane

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 <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.
parent 1e970dce
# $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 subdir = contrib/cube
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
MODULE_big = cube MODULE_big = cube
OBJS= cube.o cubeparse.o cubescan.o buffer.o OBJS= cube.o cubeparse.o buffer.o
DATA_built = cube.sql DATA_built = cube.sql
DOCS = README.cube DOCS = README.cube
REGRESS = cube REGRESS = cube
# cubescan is compiled as part of cubeparse
cubeparse.o: cubescan.c
cubeparse.c: cubeparse.h ; cubeparse.c: cubeparse.h ;
cubeparse.h: cubeparse.y cubeparse.h: cubeparse.y
......
...@@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim) ...@@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim)
return(bp); return(bp);
} }
#include "cubescan.c"
# $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 subdir = contrib/seg
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
MODULE_big = seg MODULE_big = seg
OBJS = seg.o segparse.o segscan.o buffer.o OBJS = seg.o segparse.o buffer.o
DATA_built = seg.sql DATA_built = seg.sql
DOCS = README.seg DOCS = README.seg
REGRESS = seg REGRESS = seg
# segscan is compiled as part of segparse
segparse.o: segscan.c
segparse.c: segparse.h ; segparse.c: segparse.h ;
segparse.h: segparse.y segparse.h: segparse.y
......
...@@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) { ...@@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) {
return 0; return 0;
} }
#include "segscan.c"
# $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 subdir = contrib/tsearch
top_builddir = ../.. top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
MODULE_big = tsearch 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 DATA_built = tsearch.sql
DOCS = README.tsearch DOCS = README.tsearch
REGRESS = tsearch REGRESS = tsearch
# parser is compiled as part of query
query.o: parser.c
parser.c: parser.l parser.c: parser.l
ifdef FLEX ifdef FLEX
$(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $< $(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $<
......
...@@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS) ...@@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(res); PG_RETURN_POINTER(res);
} }
#include "parser.c"
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for the bootstrap module # 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) ...@@ -14,9 +14,9 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
# qnx4's wlink currently crashes with bootstrap.o # qnx4's wlink currently crashes with bootstrap.o
ifneq ($(PORTNAME), qnx4) ifneq ($(PORTNAME), qnx4)
OBJS= bootparse.o bootscanner.o bootstrap.o OBJS= bootparse.o bootstrap.o
else else
OBJS= bootparse.o bootscanner.o OBJS= bootparse.o
endif endif
...@@ -27,8 +27,10 @@ SUBSYS.o: $(OBJS) ...@@ -27,8 +27,10 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^ $(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 # `sed' rules to remove conflicts between bootstrap scanner and parser
# and the SQL scanner and parser. For correctness' sake the rules that # and the SQL scanner and parser. For correctness' sake the rules that
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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 : ...@@ -335,3 +335,5 @@ boot_ident :
ID { $$=yylval.ival; } ID { $$=yylval.ival; }
; ;
%% %%
#include "bootscanner.c"
%{ %{
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* bootscanner.lex * bootscanner.l
* a lexical scanner for the bootstrap parser * a lexical scanner for the bootstrap parser
* *
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for parser # 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 ...@@ -10,9 +10,11 @@ subdir = src/backend/parser
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global 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 \ 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_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 FLEXFLAGS = -CF
...@@ -23,6 +25,10 @@ SUBSYS.o: $(OBJS) ...@@ -23,6 +25,10 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^ $(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. # 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 # Rules with two targets don't have that meaning, they are merely
# shorthand for two otherwise separate rules. To be safe for parallel # shorthand for two otherwise separate rules. To be safe for parallel
...@@ -52,7 +58,7 @@ endif ...@@ -52,7 +58,7 @@ endif
# Force these dependencies to be known even without dependency info built: # 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 # gram.c, parse.h, and scan.c are in the distribution tarball, so they
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -7777,3 +7777,5 @@ doNegateFloat(Value *v) ...@@ -7777,3 +7777,5 @@ doNegateFloat(Value *v)
v->val.str = newval; v->val.str = newval;
} }
} }
#include "scan.c"
# $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 subdir = src/backend/utils/misc
top_builddir = ../../../.. top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global 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 # This location might depend on the installation directories. Therefore
# we can't subsitute it into config.h. # we can't subsitute it into config.h.
...@@ -18,6 +20,9 @@ all: SUBSYS.o ...@@ -18,6 +20,9 @@ all: SUBSYS.o
SUBSYS.o: $(OBJS) SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) 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 $(srcdir)/guc-file.c: guc-file.l
ifdef FLEX ifdef FLEX
$(FLEX) $(FLEXFLAGS) $< $(FLEX) $(FLEXFLAGS) $<
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* command, configuration file, and command line options. * command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information. * 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 * Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
...@@ -3014,3 +3014,5 @@ assign_msglvl(int *var, const char *newval, bool doit, bool interactive) ...@@ -3014,3 +3014,5 @@ assign_msglvl(int *var, const char *newval, bool doit, bool interactive)
return NULL; /* fail */ return NULL; /* fail */
return newval; /* OK */ return newval; /* OK */
} }
#include "guc-file.c"
# $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 subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -17,7 +17,7 @@ ifeq ($(GCC), yes) ...@@ -17,7 +17,7 @@ ifeq ($(GCC), yes)
override CFLAGS += -Wno-error override CFLAGS += -Wno-error
endif 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 keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
...@@ -26,6 +26,9 @@ all: submake-libpgport ecpg ...@@ -26,6 +26,9 @@ all: submake-libpgport ecpg
ecpg: $(OBJS) ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(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.c: $(srcdir)/preproc.h ;
$(srcdir)/preproc.h: preproc.y $(srcdir)/preproc.h: preproc.y
...@@ -44,7 +47,7 @@ else ...@@ -44,7 +47,7 @@ else
@$(missing) flex $< $@ @$(missing) flex $< $@
endif 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 distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
......
/* $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 */ /* Copyright comment */
%{ %{
...@@ -5567,3 +5567,5 @@ void yyerror( char * error) ...@@ -5567,3 +5567,5 @@ void yyerror( char * error)
buf[sizeof(buf)-1]=0; buf[sizeof(buf)-1]=0;
mmerror(PARSE_ERROR, ET_ERROR, buf); mmerror(PARSE_ERROR, ET_ERROR, buf);
} }
#include "pgc.c"
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for the plpgsql shared object # 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) ...@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
SHLIB_LINK = $(BE_DLLLIBS) SHLIB_LINK = $(BE_DLLLIBS)
rpath := 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) ifneq ($(PORTNAME), qnx4)
all: all-lib all: all-lib
...@@ -59,7 +59,10 @@ installdirs: ...@@ -59,7 +59,10 @@ installdirs:
uninstall: uninstall:
rm -f $(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX) 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, # Note: Since the yacc and lex files are shipped in the distribution,
# they must be generated in the srcdir (as opposed to builddir). # they must be generated in the srcdir (as opposed to builddir).
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * 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. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -1997,3 +1997,5 @@ check_assignable(PLpgSQL_datum *datum) ...@@ -1997,3 +1997,5 @@ check_assignable(PLpgSQL_datum *datum)
break; break;
} }
} }
#include "pl_scan.c"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment