diff --git a/contrib/Makefile b/contrib/Makefile
index 7485110ed5f3f7c1d9d78f2a9af3d7b4aefe4ba4..0dc68e48549973b732873dd942543395bbd0d5c1 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -11,42 +11,18 @@
 # The following subdirs give make errors:
 #
 #   earthdistance
-#   findoidjoins
-#   isbn_issn
 #   os2client
-#   pginterface
 
-all:	
-	for dir in *; do \
-	    if [ -e $$dir/Makefile ]; then \
-		$(MAKE) -C $$dir; \
-	    fi; \
-	done
-
-install:	
+all:
 	for dir in *; do \
 	    if [ -e $$dir/Makefile ]; then \
 		$(MAKE) -C $$dir $@ ; \
 	    fi; \
 	done
 
-install-doc:	
-	for dir in *; do \
-	    if [ -e $$dir/Makefile ]; then \
-		$(MAKE) -C $$dir $@ ; \
-	    fi; \
-	done || exit 0
-
-clean:	
-	for dir in *; do \
-	    if [ -e $$dir/Makefile ]; then \
-		$(MAKE) -C $$dir $@ ; \
-	    fi; \
-	done || exit 0
-
-distclean:
+.DEFAULT:
 	for dir in *; do \
 	    if [ -e $$dir/Makefile ]; then \
 		$(MAKE) -C $$dir $@ ; \
 	    fi; \
-	done || exit 0
+	done
diff --git a/contrib/array/Makefile b/contrib/array/Makefile
index 951250a29dd48110e92f57e83052e7d5dacf81d2..c29569d76f57f464e3ee534ed3511618f39b1967 100644
--- a/contrib/array/Makefile
+++ b/contrib/array/Makefile
@@ -11,12 +11,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I./ \
-		-I$(SRCDIR)/ \
-		-I$(SRCDIR)/include \
-		-I$(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT) $(CFLAGS_SL)
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	array_iterator
 
@@ -61,7 +56,7 @@ $(SQLDIR):
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f *~ $(MODULE) $(MODNAME).sql
diff --git a/contrib/datetime/Makefile b/contrib/datetime/Makefile
index 195c0f8d689e2dcd57bcf288b3758c9a20d144eb..8f43ff83b7b771c35035bd3b99a39cb5c04fc9ad 100644
--- a/contrib/datetime/Makefile
+++ b/contrib/datetime/Makefile
@@ -11,12 +11,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I./ \
-		-I$(SRCDIR)/ \
-		-I$(SRCDIR)/include \
-		-I$(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT) $(CFLAGS_SL)
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	datetime_functions
 
@@ -61,7 +56,7 @@ $(SQLDIR):
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f *~ $(MODULE) $(MODNAME).sql
diff --git a/contrib/datetime/datetime_functions.c b/contrib/datetime/datetime_functions.c
index 47991a8646d9a5c94e642585482ba9871f00bf6c..ca9c8afe35e82abdca6ce2163989bad1d4719c03 100644
--- a/contrib/datetime/datetime_functions.c
+++ b/contrib/datetime/datetime_functions.c
@@ -96,7 +96,7 @@ hhmm_in(char *str)
 			   *tm = &tt;
 
 	if (!PointerIsValid(str))
-		elog(ERROR, "Bad (null) time external representation", NULL);
+		elog(ERROR, "Bad (null) time external representation");
 
 	if (decode_24h_time(str, tm, &fsec) != 0)
 		elog(ERROR, "Bad time external representation '%s'", str);
diff --git a/contrib/datetime/datetime_functions.h b/contrib/datetime/datetime_functions.h
index c345f2852b8a16d1ac5d4bfb846e750d138e254b..4b0eb49988470d9762a272ba865c0d98ee96ea2a 100644
--- a/contrib/datetime/datetime_functions.h
+++ b/contrib/datetime/datetime_functions.h
@@ -15,6 +15,7 @@ int4		date_month(DateADT val);
 int4		date_year(DateADT val);
 TimeADT    *currenttime(void);
 DateADT		currentdate(void);
+int4		date2mjd(DateADT val);
 
 #endif
 
diff --git a/contrib/fulltextindex/Makefile b/contrib/fulltextindex/Makefile
index c5986b02f76bdfa8a22265bcd6512d9e3e012566..bf1d02d227c8a7ad0f2186930dfcbd947f033035 100644
--- a/contrib/fulltextindex/Makefile
+++ b/contrib/fulltextindex/Makefile
@@ -4,7 +4,7 @@ include $(SRCDIR)/Makefile.global
 
 CONTRIBDIR=$(LIBDIR)/contrib
 
-CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
+CFLAGS+= $(CFLAGS_SL)
 
 TARGETS= fti$(DLSUFFIX)
 CLEANFILES+= $(TARGETS)
diff --git a/contrib/isbn_issn/Makefile b/contrib/isbn_issn/Makefile
index baccaf28e6c5b575fe61f4ffb21a61f1c1da6715..bd3c4325cd2f3f54daebc36867f0426997bd05d9 100644
--- a/contrib/isbn_issn/Makefile
+++ b/contrib/isbn_issn/Makefile
@@ -1,25 +1,18 @@
 #
 #	PostgreSQL types for ISBN and ISSN identifiers.
 #
-#	$Id: Makefile,v 1.1 1998/08/17 03:35:04 scrappy Exp $
+#	$Id: Makefile,v 1.2 2000/05/29 05:44:26 tgl Exp $
 
-all: isbn.so issn.so
+SRCDIR= ../../src
 
-isbn.so: isbn.o
-	ld -Bshareable -o isbn.so isbn.o
+include $(SRCDIR)/Makefile.global
 
-isbn.o: isbn.c
-	cc -g -O -fPIC -I/usr/local/pgsql/include -c isbn.c
+CFLAGS+= $(CFLAGS_SL)
 
-issn.so: issn.o
-	ld -Bshareable -o issn.so issn.o
+all: isbn$(DLSUFFIX) issn$(DLSUFFIX)
 
-issn.o: issn.c
-	cc -g -O -fPIC -I/usr/local/pgsql/include -c issn.c
+install: isbn$(DLSUFFIX) issn$(DLSUFFIX)
+	install -c isbn$(DLSUFFIX) issn$(DLSUFFIX) /usr/local/pgsql/modules
 
-install: isbn.so issn.so
-	install -c isbn.so issn.so /usr/local/pgsql/modules
-
-#
-#	eof
-#
+clean:
+	rm -f isbn$(DLSUFFIX) issn$(DLSUFFIX) *.o
diff --git a/contrib/isbn_issn/isbn.c b/contrib/isbn_issn/isbn.c
index 5f4ac8890515464b9cd487b37f6f612848a2cf73..ff63381255c2a76c27561cb94331ca8ef5b7f238 100644
--- a/contrib/isbn_issn/isbn.c
+++ b/contrib/isbn_issn/isbn.c
@@ -1,7 +1,7 @@
 /*
  *	PostgreSQL type definitions for ISBNs.
  *
- *	$Id: isbn.c,v 1.2 1999/05/25 16:05:40 momjian Exp $
+ *	$Id: isbn.c,v 1.3 2000/05/29 05:44:26 tgl Exp $
  */
 
 #include <stdio.h>
@@ -47,8 +47,6 @@ isbn *
 isbn_in(char *str)
 {
 	isbn	   *result;
-	char	   *cp;
-	int			count;
 
 	if (strlen(str) != 13)
 	{
diff --git a/contrib/isbn_issn/issn.c b/contrib/isbn_issn/issn.c
index ccb264ac8f7f6363f7eccd92f57cb99c298e6efb..145f4e38f44185d1faff3c213ff6a30877b246ef 100644
--- a/contrib/isbn_issn/issn.c
+++ b/contrib/isbn_issn/issn.c
@@ -1,7 +1,7 @@
 /*
  *	PostgreSQL type definitions for ISSNs.
  *
- *	$Id: issn.c,v 1.2 1999/05/25 16:05:42 momjian Exp $
+ *	$Id: issn.c,v 1.3 2000/05/29 05:44:26 tgl Exp $
  */
 
 #include <stdio.h>
@@ -47,8 +47,6 @@ issn *
 issn_in(char *str)
 {
 	issn	   *result;
-	char	   *cp;
-	int			count;
 
 	if (strlen(str) != 9)
 	{
diff --git a/contrib/lo/Makefile b/contrib/lo/Makefile
index 8bd08a3350ce85c908b2d1812085e0d184db549e..e091049293b7045590935c344eb9c6adf527ac0c 100644
--- a/contrib/lo/Makefile
+++ b/contrib/lo/Makefile
@@ -3,7 +3,7 @@
 #
 #	Makefile pinched from the ip-mac contrib package
 #
-#	$Id: Makefile,v 1.1 1998/06/16 07:07:11 momjian Exp $
+#	$Id: Makefile,v 1.2 2000/05/29 05:44:27 tgl Exp $
 
 SRCDIR= ../../src
 
@@ -11,7 +11,7 @@ include $(SRCDIR)/Makefile.global
 
 CONTRIBDIR=$(LIBDIR)/modules
 
-CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
+CFLAGS+= $(CFLAGS_SL)
 
 ifdef REFINT_VERBOSE
 CFLAGS+= -DREFINT_VERBOSE
diff --git a/contrib/miscutil/Makefile b/contrib/miscutil/Makefile
index fd0065b86ef6510e791ad26baea10d1c7ad9806e..742db0334f5b9268dcff46112a26f8a9560a48fe 100644
--- a/contrib/miscutil/Makefile
+++ b/contrib/miscutil/Makefile
@@ -11,12 +11,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I./ \
-		-I$(SRCDIR)/ \
-		-I$(SRCDIR)/include \
-		-I$(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT) $(CFLAGS_SL)
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	misc_utils
 
@@ -61,7 +56,7 @@ $(SQLDIR):
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f *~ $(MODULE) $(MODNAME).sql
diff --git a/contrib/miscutil/misc_utils.c b/contrib/miscutil/misc_utils.c
index 302118689dc1b9a713c2192eb64823261ff9850f..f5a98683280e3cfd9b1251662315ef8eb1150d2e 100644
--- a/contrib/miscutil/misc_utils.c
+++ b/contrib/miscutil/misc_utils.c
@@ -15,6 +15,7 @@
 #include <errno.h>
 
 #include "postgres.h"
+
 #include "access/heapam.h"
 #include "access/htup.h"
 #include "access/relscan.h"
@@ -22,14 +23,16 @@
 #include "access/tupdesc.h"
 #include "catalog/catname.h"
 #include "catalog/pg_listener.h"
+#include "fmgr.h"
 #include "storage/lmgr.h"
-#include "utils/fmgr.h"
+#include "utils/fmgroids.h"
 #include "utils/palloc.h"
 #include "utils/rel.h"
 #include "utils/tqual.h"
 
 #include "misc_utils.h"
 
+#undef MIN
 #define MIN(x,y)	((x)<=(y) ? (x) : (y))
 
 extern int	ExecutorLimit(int limit);
diff --git a/contrib/odbc/Makefile b/contrib/odbc/Makefile
index 34138c1f32140ca6d384d6e42072f63c0652b9d9..8fe1959c58db9ac925f8477b6ad59b28e788773a 100644
--- a/contrib/odbc/Makefile
+++ b/contrib/odbc/Makefile
@@ -9,7 +9,7 @@ ifndef PGLIB
   PGLIB= .
 endif
 
-CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
+CFLAGS+= $(CFLAGS_SL)
 
 TARGETS_7= odbc.sql
 TARGETS_PRE7= odbc$(DLSUFFIX) odbc-pre7.sql
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index c2b027c9eccbd7f0b788ec173aaa7a85b8a7cc5e..76ac80d68f49e4e09d4306ba3a1f62db5637adca 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,5 +1,5 @@
 /*
- * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.3 2000/04/12 17:14:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.4 2000/05/29 05:44:29 tgl Exp $
  *
  * pgbench: a simple TPC-B like benchmark program for PostgreSQL
  * written by Tatsuo Ishii
@@ -591,7 +591,7 @@ main(int argc, char **argv)
 				}
 				if (rlim.rlim_cur <= (nclients + 2))
 				{
-					fprintf(stderr, "You need at least %d open files resource but you are only allowed to use %ld.\n", nclients + 2, rlim.rlim_cur);
+					fprintf(stderr, "You need at least %d open files resource but you are only allowed to use %ld.\n", nclients + 2, (long) rlim.rlim_cur);
 					fprintf(stderr, "Use limit/ulimt to increase the limit before using pgbench.\n");
 					exit(1);
 				}
diff --git a/contrib/soundex/Makefile b/contrib/soundex/Makefile
index d95549dc01f2901f1ff3f9b0ad2e76e068f48b12..059fd6d4ee45abf9ac972275d38978b82670b2c0 100644
--- a/contrib/soundex/Makefile
+++ b/contrib/soundex/Makefile
@@ -10,25 +10,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I ./ \
-		-I $(SRCDIR)/ \
-		-I $(SRCDIR)/include \
-		-I $(SRCDIR)/interfaces/libpq \
-		-I $(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT)
-
-ifeq ($(PORTNAME), linux)
-  ifdef LINUX_ELF
-    ifeq ($(CC), gcc)
-      CFLAGS += -fPIC
-    endif
-  endif
-endif
-
-ifeq ($(PORTNAME), i386_solaris)
-  CFLAGS+= -fPIC
-endif
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	soundex
 
@@ -53,7 +35,7 @@ install:	$(MODULE)
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f $(MODULE) $(MODNAME).sql
diff --git a/contrib/soundex/soundex.c b/contrib/soundex/soundex.c
index df0c8366b95064c6d8dfbbd8fd48d4da01ca2fbb..8fe73054cafae642d8986e6ca418b838aeb12e93 100644
--- a/contrib/soundex/soundex.c
+++ b/contrib/soundex/soundex.c
@@ -2,23 +2,21 @@
 /* soundex.c */
 /*****************************************************************************/
 
+#include <ctype.h>
 #include <string.h>
 #include <stdio.h>
+
 #include "postgres.h"			/* for char16, etc. */
+
 #include "utils/palloc.h"		/* for palloc */
-#include "libpq-fe.h"			/* for TUPLE */
-#include <stdio.h>
-#include <ctype.h>
 
-/* prototype for soundex function */
+/* prototypes for soundex functions */
+text	   *text_soundex(text *t);
 char	   *soundex(char *instr, char *outstr);
 
 text *
 text_soundex(text *t)
 {
-	/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
-	char	   *table = "01230120022455012623010202";
-	int			count = 0;
 	text	   *new_t;
 
 	char		outstr[6 + 1];	/* max length of soundex is 6 */
@@ -49,7 +47,8 @@ text_soundex(text *t)
 
 char *
 soundex(char *instr, char *outstr)
-{								/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
+{
+	/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
 	char	   *table = "01230120022455012623010202";
 	int			count = 0;
 
diff --git a/contrib/spi/Makefile b/contrib/spi/Makefile
index e4deb393d43ed0e057dc2064018fe2d1cb418b30..639a6247dae19460ad5930a6313e0223d90e09ef 100644
--- a/contrib/spi/Makefile
+++ b/contrib/spi/Makefile
@@ -3,7 +3,7 @@ SRCDIR= ../../src
 
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
+CFLAGS+= $(CFLAGS_SL)
 
 ifdef REFINT_VERBOSE
 CFLAGS+= -DREFINT_VERBOSE
diff --git a/contrib/string/Makefile b/contrib/string/Makefile
index dd8f0e6f2a6071a4039a0067523be9cdb5fa4069..d372aa08457be452de6ff4fc6e91425d3c16c965 100644
--- a/contrib/string/Makefile
+++ b/contrib/string/Makefile
@@ -11,12 +11,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I./ \
-		-I$(SRCDIR)/ \
-		-I$(SRCDIR)/include \
-		-I$(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT) $(CFLAGS_SL)
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	string_io
 
@@ -61,7 +56,7 @@ $(SQLDIR):
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f *~ $(MODULE) $(MODNAME).sql
diff --git a/contrib/string/string_io.c b/contrib/string/string_io.c
index cb8323d9c9b75650429cc753536fcf65682419bf..c329fec1e9e3017e051b9a2598ede47fd919586f 100644
--- a/contrib/string/string_io.c
+++ b/contrib/string/string_io.c
@@ -22,6 +22,7 @@
 /* define this if you want to see iso-8859 characters */
 #define ISO8859
 
+#undef MIN
 #define MIN(x, y)	((x) < (y) ? (x) : (y))
 #define VALUE(char) ((char) - '0')
 #define DIGIT(val)	((val) + '0')
diff --git a/contrib/userlock/Makefile b/contrib/userlock/Makefile
index 23975185b2a8f78f10583ac3e8e86e66fc5cd4e6..983f20a547cdecb697d84f7138bab81ce476e5d5 100644
--- a/contrib/userlock/Makefile
+++ b/contrib/userlock/Makefile
@@ -11,12 +11,7 @@ SRCDIR = $(PGDIR)/src
 
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT =	-I./ \
-		-I$(SRCDIR)/ \
-		-I$(SRCDIR)/include \
-		-I$(SRCDIR)/port/$(PORTNAME)
-
-CFLAGS += $(INCLUDE_OPT) $(CFLAGS_SL)
+CFLAGS += -I. $(CFLAGS_SL)
 
 MODNAME =	user_locks
 
@@ -61,7 +56,7 @@ $(SQLDIR):
 		$(CC) $(CFLAGS) -shared -o $@ $<
 
 depend dep:
-		$(CC) -MM $(INCLUDE_OPT) *.c >depend
+		$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 		rm -f *~ $(MODULE) $(MODNAME).sql
diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile
index 95214acb9826a5bc494f34d3d94ace150af4d71d..c9484024b58065d49603252594136f4915263c37 100644
--- a/contrib/vacuumlo/Makefile
+++ b/contrib/vacuumlo/Makefile
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/contrib/vacuumlo/Makefile,v 1.1 1999/04/10 16:48:04 peter Exp $
+# $Header: /cvsroot/pgsql/contrib/vacuumlo/Makefile,v 1.2 2000/05/29 05:44:32 tgl Exp $
 
 SRCDIR= ../../src
 
@@ -6,7 +6,7 @@ include $(SRCDIR)/Makefile.global
 
 CONTRIBDIR=$(LIBDIR)/contrib
 
-CFLAGS+= -I$(HEADERDIR)
+CFLAGS+= -I$(LIBPQDIR)
 
 TARGETS= vacuumlo
 CLEANFILES+= $(TARGETS)
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index afeadbc6f4d9d393b6d562972cd3994c4fbc52cc..db3a3233454d6226c9be170d7fe8ae6751c63977 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.74 2000/05/27 04:13:04 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.75 2000/05/29 05:44:32 tgl Exp $
 #
 # NOTES
 #    Essentially all Postgres make files include this file and use the
@@ -208,7 +208,7 @@ YFLAGS= @YFLAGS@
 YACC= @YACC@
 LEX= @LEX@
 AROPT= @AROPT@
-CFLAGS= -I$(SRCDIR)/include -I$(SRCDIR)/backend @CPPFLAGS@ @CFLAGS@
+CFLAGS= -I$(SRCDIR)/include @CPPFLAGS@ @CFLAGS@
 CFLAGS_SL= @SHARED_LIB@
 PGSQL_INCLUDES= @PGSQL_INCLUDES@
 LIBS= @LIBS@
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 6af51106bd399d6002ceb0ec3bcaa3e0d90b2ffd..ee068ef1de865a190558fe47acd970c398190670 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -29,12 +29,12 @@
 #
 #   We don't use $(LD) for linking.  We use $(CC) instead.  This is because
 #   the $(CC) program apparently can do linking too, and it has certain
-#   thinks like default options and search paths for libraries set up for 
+#   things like default options and search paths for libraries set up for 
 #   it that the more primitive $(LD) doesn't have.
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.48 2000/05/28 17:55:51 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.49 2000/05/29 05:44:33 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -50,9 +50,11 @@ DIRS += tioga
 endif
 
 OBJS = $(DIRS:%=%/SUBSYS.o)
+
 ifeq ($(PORTNAME), qnx4)
-# This file chrashes wlink and is therefore not in bootstrap/SUBSYS.o.
-OBJS1 = bootstrap/bootstrap.o
+# This file crashes qnx4's wlink and is therefore not in bootstrap/SUBSYS.o
+# on that platform.  (Wotta hack ... is it still necessary?)
+OBJS+= bootstrap/bootstrap.o
 endif
 
 VERSIONOBJ = $(SRCDIR)/utils/version.o
@@ -75,22 +77,25 @@ libpostgres.a: $(DLLOBJS) $(SRCDIR)/utils/dllinit.o postgres.def
 	$(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@
 endif
 
-all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source \
-				global1.description local1_template1.description
+all: prebuildheaders postgres $(POSTGRES_IMP) \
+		global1.bki.source local1_template1.bki.source \
+		global1.description local1_template1.description
 
 ifneq ($(PORTNAME), win)
-postgres: utils/fmgroids.h $(OBJS) $(VERSIONOBJ)
-	$(CC) $(CFLAGS) -o postgres $(OBJS) $(OBJS1) $(VERSIONOBJ) $(LDFLAGS)
+
+postgres: $(OBJS) $(VERSIONOBJ)
+	$(CC) $(CFLAGS) -o postgres $(OBJS) $(VERSIONOBJ) $(LDFLAGS)
+
 else
+
 postgres: $(DLLOBJS) $(SRCDIR)/utils/dllinit.o postgres.def libpostgres.a
 	dlltool --dllname $@$(X) --output-exp $@.exp --def postgres.def
 	gcc -g -o $@$(X) -Wl,--base-file,$@.base $@.exp $(DLLOBJS) $(DLLLIBS)
 	dlltool --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
 	gcc -g -o $@$(X) $@.exp $(DLLOBJS) $(DLLLIBS)
 	rm $@.exp $@.base
-endif
 
-#.PHONY: postgres
+endif
 
 $(OBJS): $(DIRS:%=%.dir)
 
@@ -114,24 +119,36 @@ catalog/global1.description catalog/local1_template1.description:
 # The postgres.o target is needed by the rule in Makefile.global that
 # creates the exports file when MAKE_EXPORTS = true.
 postgres.o: $(OBJS)
-	$(CC) $(LDREL) $(LDOUT) postgres.o $(OBJS) $(OBJS1) $(LDFLAGS)
+	$(CC) $(LDREL) $(LDOUT) postgres.o $(OBJS) $(LDFLAGS)
+
+# These header files should be up-to-date before we do much else...
+.PHONY: prebuildheaders
+
+prebuildheaders: $(SRCDIR)/include/parser/parse.h \
+		$(SRCDIR)/include/utils/fmgroids.h
 
 ############################################################################
 # The following targets are specified in make commands that appear in the
-# make files in our subdirectories.
+# make files in our subdirectories.  Note that it's important we match the
+# dependencies shown in the subdirectory makefiles!
 
-parse.h: parser/parse.h
-	cp parser/parse.h .
+$(SRCDIR)/include/parser/parse.h: parser/parse.h
+	cp parser/parse.h $(SRCDIR)/include/parser
 
-parser/parse.h:
+parser/parse.h: parser/gram.y
 	$(MAKE) -C parser parse.h
 
-utils/fmgroids.h:
+$(SRCDIR)/include/utils/fmgroids.h: utils/fmgroids.h
+	cp utils/fmgroids.h $(SRCDIR)/include/utils
+
+utils/fmgroids.h: utils/Gen_fmgrtab.sh $(SRCDIR)/include/catalog/pg_proc.h
 	$(MAKE) -C utils fmgroids.h
 
 #############################################################################
 clean:
-	rm -f postgres$(X) $(POSTGRES_IMP) parse.h \
+	rm -f postgres$(X) $(POSTGRES_IMP) \
+		$(SRCDIR)/include/parser/parse.h \
+		$(SRCDIR)/include/utils/fmgroids.h \
 	    global1.bki.source local1_template1.bki.source \
 	    global1.description local1_template1.description
 ifeq ($(PORTNAME), win)
@@ -141,6 +158,9 @@ endif
 endif
 	for i in $(DIRS); do $(MAKE) -C $$i clean; done
 
+depend dep: prebuildheaders
+	for i in $(DIRS); do $(MAKE) -C $$i $@; done
+
 .DEFAULT:
 	for i in $(DIRS); do $(MAKE) -C $$i $@; done
 
@@ -202,7 +222,7 @@ install-templates: $(TEMPLATEDIR) \
 	$(INSTALL) $(INSTLOPTS) pg_options.sample \
 	  $(TEMPLATEDIR)/pg_options.sample
 
-install-headers: utils/fmgroids.h $(SRCDIR)/include/config.h
+install-headers: prebuildheaders $(SRCDIR)/include/config.h
 	-@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
 	-@if [ ! -d $(HEADERDIR)/port ]; then mkdir $(HEADERDIR)/port; fi
 	-@if [ ! -d $(HEADERDIR)/port/$(PORTNAME) ]; \
@@ -239,7 +259,7 @@ install-headers: utils/fmgroids.h $(SRCDIR)/include/config.h
           $(HEADERDIR)/utils/geo_decls.h
 	$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/elog.h \
           $(HEADERDIR)/utils/elog.h
-	$(INSTALL) $(INSTLOPTS) utils/fmgroids.h \
+	$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/fmgroids.h \
           $(HEADERDIR)/utils/fmgroids.h
 	$(INSTALL) $(INSTLOPTS) $(SRCDIR)/include/utils/palloc.h \
           $(HEADERDIR)/utils/palloc.h
@@ -284,7 +304,7 @@ endif
 # are up to date.  It saves the time of doing all the submakes.
 .PHONY: quick
 quick: $(OBJS)
-	$(CC) -o postgres $(OBJS) $(OBJS1) $(LDFLAGS)
+	$(CC) -o postgres $(OBJS) $(LDFLAGS)
 
 #
 # Build the file, "./ID", used by the "gid" (grep-for-identifier) tool
diff --git a/src/backend/access/common/Makefile b/src/backend/access/common/Makefile
index 847b06b1d21c84a481ba5995f762b7a0897b1533..a721414c547970694ff56609b7c69ba8a33a2213 100644
--- a/src/backend/access/common/Makefile
+++ b/src/backend/access/common/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/common
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.17 2000/05/28 17:55:52 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.18 2000/05/29 05:44:33 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS+=-I../..
-
 OBJS = heaptuple.o indextuple.o indexvalid.o printtup.o \
        scankey.o tupdesc.o  
 
diff --git a/src/backend/access/gist/Makefile b/src/backend/access/gist/Makefile
index 920443de0efe5125076bf6cbe7dfe88b2ee947f7..795603473e177fa5d1d2574a2896b4c1a53b4e8b 100644
--- a/src/backend/access/gist/Makefile
+++ b/src/backend/access/gist/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/gist
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/gist/Makefile,v 1.8 1999/12/13 22:32:21 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/gist/Makefile,v 1.9 2000/05/29 05:44:34 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = gist.o gistget.o gistscan.o giststrat.o
 
 all: SUBSYS.o
diff --git a/src/backend/access/hash/Makefile b/src/backend/access/hash/Makefile
index 07e81dae79fd9d5d1ebde19ca2964c968ee9b0c8..b1736261658ca837b496d93ec83cb107fdf1e36b 100644
--- a/src/backend/access/hash/Makefile
+++ b/src/backend/access/hash/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/hash
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/hash/Makefile,v 1.8 1999/12/13 22:32:23 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/hash/Makefile,v 1.9 2000/05/29 05:44:35 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = hash.o hashfunc.o hashinsert.o hashovfl.o hashpage.o hashscan.o \
        hashsearch.o hashstrat.o hashutil.o
 
diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile
index 2671e52f538aa5f6d991ed11e3f5089ea79dfbc0..50f891a7522c51a2f6c675b9da85bddc7e5927fb 100644
--- a/src/backend/access/heap/Makefile
+++ b/src/backend/access/heap/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/heap
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.9 1999/12/21 00:06:40 wieck Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.10 2000/05/29 05:44:35 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = heapam.o hio.o stats.o tuptoaster.o
 
 all: SUBSYS.o
diff --git a/src/backend/access/index/Makefile b/src/backend/access/index/Makefile
index 58b3ca34cb9310f8f1636baedb998fa0aa17f499..153ec74b0c0a852d96d2f7b77d85f5845af885ab 100644
--- a/src/backend/access/index/Makefile
+++ b/src/backend/access/index/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/index
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/index/Makefile,v 1.8 1999/12/13 22:32:26 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/index/Makefile,v 1.9 2000/05/29 05:44:38 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = genam.o indexam.o istrat.o
 
 all: SUBSYS.o
diff --git a/src/backend/access/nbtree/Makefile b/src/backend/access/nbtree/Makefile
index b93e14bbae0b62ceb271176da04321f74a405d89..3f0c678ac4ffee407038849368d4a46accc42bb9 100644
--- a/src/backend/access/nbtree/Makefile
+++ b/src/backend/access/nbtree/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/nbtree
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/nbtree/Makefile,v 1.8 1999/12/13 22:32:28 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/nbtree/Makefile,v 1.9 2000/05/29 05:44:39 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = nbtcompare.o nbtinsert.o nbtpage.o nbtree.o nbtscan.o nbtsearch.o \
        nbtstrat.o nbtutils.o nbtsort.o
 
diff --git a/src/backend/access/rtree/Makefile b/src/backend/access/rtree/Makefile
index 6310cf8a1e5807a73f072ec82f7a197f6243368a..ad664c9b6ae9b0ed5c6543ff356b2bbd309c3da4 100644
--- a/src/backend/access/rtree/Makefile
+++ b/src/backend/access/rtree/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/rtree
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/Makefile,v 1.8 1999/12/13 22:32:30 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/Makefile,v 1.9 2000/05/29 05:44:39 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = rtget.o rtproc.o rtree.o rtscan.o rtstrat.o
 
 all: SUBSYS.o
diff --git a/src/backend/access/transam/Makefile b/src/backend/access/transam/Makefile
index 785f9e39e89a3017d1aa001c631d9e892e693c90..fee5f491451404ba5189eb1bd985e96e8ebeb5ca 100644
--- a/src/backend/access/transam/Makefile
+++ b/src/backend/access/transam/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for access/transam
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.10 1999/12/13 22:32:32 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.11 2000/05/29 05:44:41 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../.. 
-
 OBJS = transam.o transsup.o varsup.o xact.o xid.o xlog.o rmgr.o
 
 all: SUBSYS.o
diff --git a/src/backend/bootstrap/Makefile b/src/backend/bootstrap/Makefile
index b9f9270416e35e219adb5d7f3495fe9d50d1d100..9cffe422f01443e99b4499f0d3bd578a4e2dc065 100644
--- a/src/backend/bootstrap/Makefile
+++ b/src/backend/bootstrap/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for the bootstrap module
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.21 2000/01/19 02:58:51 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.22 2000/05/29 05:44:42 tgl Exp $
 #
 #
 # We must build bootparse.c and bootscanner.c with yacc and lex and sed,
@@ -19,9 +19,7 @@
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
-include ../../Makefile.global
-
-CFLAGS += -I..
+include $(SRCDIR)/Makefile.global
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
@@ -29,20 +27,18 @@ endif
 
 BOOTYACCS= bootstrap_tokens.h bootparse.c
 
+ifneq ($(PORTNAME), qnx4)
 OBJS= bootparse.o bootscanner.o bootstrap.o 
-ifeq ($(PORTNAME), qnx4)
-# wlink currently crashes with bootstrap.o
-OBJS1= bootparse.o bootscanner.o
+else
+# qnx4's wlink currently crashes with bootstrap.o
+OBJS= bootparse.o bootscanner.o
 endif
 
-all: SUBSYS.o
+# make sure bootstrap.o is built even on qnx4
+all: SUBSYS.o bootstrap.o
 
 SUBSYS.o: $(OBJS)
-ifneq ($(PORTNAME), qnx4)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
-else
-	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS1)
-endif
 
 # bootstrap.o's dependency on bootstrap_tokens.h is computed by the
 # make depend, but we state it here explicitly anyway because 
@@ -65,7 +61,7 @@ bootscanner.c: bootscanner.l
 	rm -f lex.yy.c sedfile
 
 clean:
-	rm -f SUBSYS.o $(OBJS)
+	rm -f SUBSYS.o $(OBJS) bootstrap.o
 # And the garbage that might have been left behind by partial build:
 	rm -f y.tab.h y.tab.c y.output lex.yy.c
 
@@ -77,4 +73,3 @@ dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
 ifeq (depend,$(wildcard depend))
 include depend
 endif
-
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 3dfe2c25d9db3ba9e105864c40b01062acb02b91..307ebcc3cf2044b14fad9ce39b527a15804937bc 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for catalog
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.20 1999/12/13 22:32:36 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.21 2000/05/29 05:44:43 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 OBJS = catalog.o heap.o index.o indexing.o aclchk.o \
        pg_aggregate.o pg_operator.o pg_proc.o pg_type.o
 
diff --git a/src/backend/commands/Makefile b/src/backend/commands/Makefile
index b0ee3f1e0df218c5445255fa1c3720cc5d54d3f5..c5916064609c1eeed1b2cced13ecceed00d15904 100644
--- a/src/backend/commands/Makefile
+++ b/src/backend/commands/Makefile
@@ -4,14 +4,12 @@
 #    Makefile for commands
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.23 2000/01/19 02:58:51 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.24 2000/05/29 05:44:44 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
-include ../../Makefile.global
-
-CFLAGS += -I..
+include $(SRCDIR)/Makefile.global
 
 OBJS = async.o creatinh.o command.o comment.o copy.o indexcmds.o define.o \
        remove.o rename.o vacuum.o view.o cluster.o \
@@ -23,15 +21,6 @@ all: SUBSYS.o
 SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
-# The following declares a hard-coded dependency on parse.h since, 
-# if compiled without make dep, comment.c would get compiled before 
-# the parser. 
-
-comment.o: ../parse.h
-
-../parse.h:
-	$(MAKE) -C .. parse.h
-
 depend dep:
 	$(CC) -MM $(CFLAGS) *.c >depend
 
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c
index 22ae154769104c64732022f1f1fe36d038b8122d..2d7663d6d4955413441ce9026fcdbdc056ad9433 100644
--- a/src/backend/commands/command.c
+++ b/src/backend/commands/command.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.73 2000/05/29 01:59:06 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.74 2000/05/29 05:44:44 tgl Exp $
  *
  * NOTES
  *	  The PortalExecutorHeapMemory crap needs to be eliminated
@@ -51,7 +51,7 @@
 #include "commands/comment.h"
 #include "access/genam.h"
 #include "optimizer/clauses.h"
-#include "../parser/parse.h"
+#include "parser/parse.h"
 #endif	 /* _DROP_COLUMN_HACK__ */
 
 /* ----------------
diff --git a/src/backend/executor/Makefile b/src/backend/executor/Makefile
index 5d2f97fcee9d1e224d1fadfb9e75c6c1568c846a..e0477405d561c99be06f3523e2d7cee8fe8a2afc 100644
--- a/src/backend/executor/Makefile
+++ b/src/backend/executor/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for executor
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.11 1999/12/13 22:32:40 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.12 2000/05/29 05:44:45 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 OBJS = execAmi.o execFlatten.o execJunk.o execMain.o \
        execProcnode.o execQual.o execScan.o execTuples.o \
        execUtils.o functions.o nodeAppend.o nodeAgg.o nodeHash.o \
diff --git a/src/backend/lib/Makefile b/src/backend/lib/Makefile
index 2e43ba3f09228ad9cf7ead9f557ee3ff41e27fbc..6b8a9d720227cce18619c02e64ee238e81bdb44b 100644
--- a/src/backend/lib/Makefile
+++ b/src/backend/lib/Makefile
@@ -4,17 +4,13 @@
 #    Makefile for lib (miscellaneous stuff)
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/lib/Makefile,v 1.12 1999/12/13 22:32:41 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/lib/Makefile,v 1.13 2000/05/29 05:44:45 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 OBJS = bit.o fstack.o hasht.o lispsort.o stringinfo.o dllist.o
 
 all: SUBSYS.o
@@ -23,7 +19,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) 
diff --git a/src/backend/libpq/Makefile b/src/backend/libpq/Makefile
index 50f5f1b7206f5c70d8cc748bce6cfb9519cd92ae..b1366f0ba6500db10ac165b128e5fc1d424e1394 100644
--- a/src/backend/libpq/Makefile
+++ b/src/backend/libpq/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for libpq subsystem (backend half of libpq interface)
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.18 2000/05/28 17:55:56 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.19 2000/05/29 05:44:46 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 # kerberos flags
 ifdef KRBVERS
 CFLAGS+= $(KRBFLAGS)
diff --git a/src/backend/main/Makefile b/src/backend/main/Makefile
index 6befeaf54131c71784acf668e496c019efb78384..77a69599f6ead1838abf0331ae4cbaae27eb04e0 100644
--- a/src/backend/main/Makefile
+++ b/src/backend/main/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for main
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/main/Makefile,v 1.7 1999/12/13 22:32:45 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/main/Makefile,v 1.8 2000/05/29 05:44:47 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 OBJS = main.o
 
 all: SUBSYS.o
diff --git a/src/backend/nodes/Makefile b/src/backend/nodes/Makefile
index 42c86e3d72526f5ec0a3986ce06a2bbc0d03722f..ac239bcd6f999898e38923135ea5e6b8fdaf3426 100644
--- a/src/backend/nodes/Makefile
+++ b/src/backend/nodes/Makefile
@@ -4,14 +4,12 @@
 #    Makefile for nodes
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/nodes/Makefile,v 1.10 1999/12/13 22:32:47 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/nodes/Makefile,v 1.11 2000/05/29 05:44:47 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
-include ../../Makefile.global
-
-CFLAGS += -I..
+include $(SRCDIR)/Makefile.global
 
 OBJS = nodeFuncs.o nodes.o list.o \
        copyfuncs.o equalfuncs.o freefuncs.o makefuncs.o outfuncs.o \
@@ -22,12 +20,7 @@ all: SUBSYS.o
 SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
-outfuncs.o: ../parse.h
-
-../parse.h:
-	$(MAKE) -C .. parse.h
-
-depend dep: ../parse.h
+depend dep:
 	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index db8458c37b96f262825b0322957a70b8cf8ad466..7c46177925989fa7e346d87add28e263d973baaa 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- *	$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.116 2000/05/25 22:43:12 tgl Exp $
+ *	$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.117 2000/05/29 05:44:47 tgl Exp $
  *
  * NOTES
  *	  Every (plan) node in POSTGRES has an associated "out" routine which
@@ -36,11 +36,11 @@
 #include "nodes/plannodes.h"
 #include "nodes/primnodes.h"
 #include "nodes/relation.h"
+#include "parser/parse.h"
 #include "utils/datum.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
 
-#include "../parse.h"
 
 static void _outDatum(StringInfo str, Datum value, Oid type);
 static void _outNode(StringInfo str, void *obj);
diff --git a/src/backend/optimizer/geqo/Makefile b/src/backend/optimizer/geqo/Makefile
index 6ca017bd35d7b384c7855e6dfc21aa6ced50dec0..f0e6ca4e513f92176a855bc2c92bfc125afce505 100644
--- a/src/backend/optimizer/geqo/Makefile
+++ b/src/backend/optimizer/geqo/Makefile
@@ -5,15 +5,13 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Id: Makefile,v 1.13 1999/12/13 22:32:50 momjian Exp $
+# $Id: Makefile,v 1.14 2000/05/29 05:44:48 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
 endif
diff --git a/src/backend/optimizer/path/Makefile b/src/backend/optimizer/path/Makefile
index fcca74f315b607a0bb695d36ff2d7ffe5300a156..2c4c906b8cc44eceb2526c0e487722a8c165f92e 100644
--- a/src/backend/optimizer/path/Makefile
+++ b/src/backend/optimizer/path/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for optimizer/path
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Makefile,v 1.13 2000/02/07 04:40:59 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Makefile,v 1.14 2000/05/29 05:44:50 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = allpaths.o clausesel.o costsize.o indxpath.o \
        joinpath.o joinrels.o orindxpath.o pathkeys.o tidpath.o
 
diff --git a/src/backend/optimizer/plan/Makefile b/src/backend/optimizer/plan/Makefile
index f0b394e6d6786303e88d37e43a671f7d47d207f4..5d0ef0fbfafb65e80279cd11ade44c4c13f55f1d 100644
--- a/src/backend/optimizer/plan/Makefile
+++ b/src/backend/optimizer/plan/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for optimizer/plan
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/plan/Makefile,v 1.9 1999/12/13 22:32:54 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/plan/Makefile,v 1.10 2000/05/29 05:44:51 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = createplan.o initsplan.o planmain.o planner.o setrefs.o subselect.o
 
 # not ready yet: predmig.o xfunc.o
diff --git a/src/backend/optimizer/prep/Makefile b/src/backend/optimizer/prep/Makefile
index f45708ebc52712b4b802a01dc309792d8f851964..313b3fa7ac32ab36a6bb3bdf8e4cff34f7f9dd73 100644
--- a/src/backend/optimizer/prep/Makefile
+++ b/src/backend/optimizer/prep/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for optimizer/prep
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.10 1999/12/13 22:32:55 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.11 2000/05/29 05:44:52 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = prepqual.o preptlist.o prepunion.o prepkeyset.o
 
 # not ready yet: predmig.o xfunc.o
diff --git a/src/backend/optimizer/util/Makefile b/src/backend/optimizer/util/Makefile
index 15dfc77fca2a41f459c7391c4b58edc9284222ce..dbed9f11acfec6d04224316b3e6cd09890a0a92b 100644
--- a/src/backend/optimizer/util/Makefile
+++ b/src/backend/optimizer/util/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for optimizer/util
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.11 1999/12/13 22:32:58 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.12 2000/05/29 05:44:53 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = restrictinfo.o clauses.o indexnode.o plancat.o \
        joininfo.o pathnode.o relnode.o tlist.o var.o
 
diff --git a/src/backend/parser/Makefile b/src/backend/parser/Makefile
index 6f3a9310efeb366deda3672ea10fbd8902cafa7d..1fdbd55a3824447459f8989a41985aac92b72719 100644
--- a/src/backend/parser/Makefile
+++ b/src/backend/parser/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for parser
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.24 2000/01/19 02:58:53 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.25 2000/05/29 05:44:53 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
 endif
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 6f454063626b6f67661bcfce5961677d9f4c7ff1..be40612a98c2a9d549c4d665a4674a60524f8a70 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- *	$Id: analyze.c,v 1.143 2000/05/28 17:56:00 tgl Exp $
+ *	$Id: analyze.c,v 1.144 2000/05/29 05:44:53 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -18,8 +18,8 @@
 #include "catalog/pg_index.h"
 #include "catalog/pg_type.h"
 #include "nodes/makefuncs.h"
-#include "parse.h"
 #include "parser/analyze.h"
+#include "parser/parse.h"
 #include "parser/parse_agg.h"
 #include "parser/parse_clause.h"
 #include "parser/parse_relation.h"
diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c
index f30abe49153991a7e7859576caec54aefcc7b3b0..ffdcb9a61ce0b129a7024f64f2072014d8cc088a 100644
--- a/src/backend/parser/keywords.c
+++ b/src/backend/parser/keywords.c
@@ -8,17 +8,18 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.71 2000/04/12 17:15:26 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.72 2000/05/29 05:44:54 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include <ctype.h>
 
 #include "postgres.h"
+
 #include "nodes/parsenodes.h"
 #include "nodes/pg_list.h"
-#include "parse.h"
 #include "parser/keywords.h"
+#include "parser/parse.h"
 
 /*
  * List of (keyword-name, keyword-token-value) pairs.
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 7893b52f6046970421fd1327b4752dd764e42d8c..106717629018bc5b984a2da294b64bc63c689ec8 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -8,17 +8,18 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.60 2000/05/12 01:33:54 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.61 2000/05/29 05:44:54 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include "postgres.h"
+
 #include "access/heapam.h"
 #include "miscadmin.h"
 #include "optimizer/tlist.h"
-#include "parse.h"
 #include "nodes/makefuncs.h"
+#include "parser/parse.h"
 #include "parser/parse_clause.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_expr.h"
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 0f16f25aff2052c6b2362ae0ea11ccfcada3d43b..eb51f0696b2884585bf79089674fd8062b2bbced 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.77 2000/05/25 22:42:18 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.78 2000/05/29 05:44:54 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -20,9 +20,9 @@
 #include "nodes/makefuncs.h"
 #include "nodes/params.h"
 #include "nodes/relation.h"
-#include "parse.h"
 #include "parser/analyze.h"
 #include "parser/gramparse.h"
+#include "parser/parse.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_expr.h"
 #include "parser/parse_func.h"
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 2eb0934adec1e50c1b16abb6826c108562759075..6d904198209d0ffae3fb471651c95dc9f5536a8d 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.69 2000/05/27 05:13:38 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.70 2000/05/29 05:44:54 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -25,9 +25,9 @@
 #include "miscadmin.h"
 #include "nodes/parsenodes.h"
 #include "nodes/pg_list.h"
-#include "parse.h"
 #include "parser/gramparse.h"
 #include "parser/keywords.h"
+#include "parser/parse.h"
 #include "parser/scansup.h"
 #include "utils/builtins.h"
 
diff --git a/src/backend/port/Makefile.in b/src/backend/port/Makefile.in
index 190651cab202a8035a90d36c0d80dd5300c47e45..17605c41dac2c8f3a0d861d1b87bfb9651800318 100644
--- a/src/backend/port/Makefile.in
+++ b/src/backend/port/Makefile.in
@@ -13,15 +13,13 @@
 # be converted to Method 2.  
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.22 2000/05/19 02:50:32 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.23 2000/05/29 05:44:54 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR=../..
 include ../../Makefile.global
 
-CFLAGS+= -I..
-
 OBJS = dynloader.o @INET_ATON@ @STRERROR@ @MISSING_RANDOM@ @SRANDOM@
 OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @STRCASECMP@ @STRDUP@ @TAS@ @ISINF@
 OBJS+= @STRTOL@ @STRTOUL@ @SNPRINTF@
diff --git a/src/backend/port/nextstep/Makefile b/src/backend/port/nextstep/Makefile
index 8e5f4ffd0d17b1ae3fef1ba6447a56ade5a50b93..1399014dde82212a6379efdbf6cff043421f5a24 100644
--- a/src/backend/port/nextstep/Makefile
+++ b/src/backend/port/nextstep/Makefile
@@ -8,10 +8,6 @@
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 OBJS = dynloader.o port.o
 
 all: SUBSYS.o
@@ -20,7 +16,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 	rm -f SUBSYS.o $(OBJS)
diff --git a/src/backend/port/qnx4/Makefile b/src/backend/port/qnx4/Makefile
index 82653290356cabfddfc8d665ab260ae98eefe963..b367d9bbfbd30f67bad8e71cf83394f6a34702d5 100644
--- a/src/backend/port/qnx4/Makefile
+++ b/src/backend/port/qnx4/Makefile
@@ -4,17 +4,13 @@
 #    Makefile for port/sparc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.1 1999/12/16 16:52:52 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.2 2000/05/29 05:44:56 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 OBJS = isnan.o rint.o sem.o shm.o
 
 all: SUBSYS.o tstrint tstsem tstshm
@@ -32,7 +28,7 @@ tstshm: tstshm.o shm.o
 	$(CC) -o tstshm shm.o tstshm.o
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) tstrint tstrint.o tstsem tstsem.o tstshm tstshm.o
diff --git a/src/backend/port/sunos4/Makefile b/src/backend/port/sunos4/Makefile
index 671150009ce99f92d815f311dd8ad01c4e21679b..c95833402288d84fb4d24159b63a38b087bcd8b1 100644
--- a/src/backend/port/sunos4/Makefile
+++ b/src/backend/port/sunos4/Makefile
@@ -4,17 +4,13 @@
 #    Makefile for port/sparc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/port/sunos4/Attic/Makefile,v 1.4 1999/12/13 22:33:15 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/port/sunos4/Attic/Makefile,v 1.5 2000/05/29 05:44:57 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 OBJS = strtol.o
 
 all: SUBSYS.o
@@ -23,7 +19,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS)
diff --git a/src/backend/postmaster/Makefile b/src/backend/postmaster/Makefile
index 3896245b9954a43b6b746a84d5e89c6d23a8973e..ce8124e96a19a2766e2248b67fbdfd9ae8826c25 100644
--- a/src/backend/postmaster/Makefile
+++ b/src/backend/postmaster/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for postmaster
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.10 1999/12/13 22:33:19 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.11 2000/05/29 05:44:58 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 OBJS = postmaster.o
 
 all: SUBSYS.o
diff --git a/src/backend/regex/Makefile b/src/backend/regex/Makefile
index 9beda9746e83295b3d274903ebf62c71df67f23a..4d6935b7f1f0875debd35a6fb1800b1140c243df 100644
--- a/src/backend/regex/Makefile
+++ b/src/backend/regex/Makefile
@@ -4,14 +4,13 @@
 #    Makefile for regex
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.12 2000/01/19 02:58:53 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.13 2000/05/29 05:44:58 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
 CFLAGS += -DPOSIX_MISTAKE 
 
 DEBUGOBJ =
diff --git a/src/backend/rewrite/Makefile b/src/backend/rewrite/Makefile
index a38cbb268e990a1c38368947b46275c4ea88288c..d47c7051017b896f1e41d81aa5ecf027befae56b 100644
--- a/src/backend/rewrite/Makefile
+++ b/src/backend/rewrite/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for rewrite
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/rewrite/Makefile,v 1.11 2000/01/19 02:58:54 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/rewrite/Makefile,v 1.12 2000/05/29 05:44:59 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-CFLAGS += -I..
-
 OBJS = rewriteRemove.o rewriteDefine.o \
        rewriteHandler.o rewriteManip.o rewriteSupport.o locks.o
 
diff --git a/src/backend/storage/buffer/Makefile b/src/backend/storage/buffer/Makefile
index 20cf9f93bc3f2514d3f8e94c0647059241a41985..5968a46bba220e58a2bf0dbcb45e80bd188359da 100644
--- a/src/backend/storage/buffer/Makefile
+++ b/src/backend/storage/buffer/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/buffer
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.13 1999/12/13 22:33:37 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.14 2000/05/29 05:45:00 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o s_lock.o
 
 all: SUBSYS.o
diff --git a/src/backend/storage/file/Makefile b/src/backend/storage/file/Makefile
index ca10b956790a6c2aaec63d575e1bb08adc6ac93f..d011d4a7a0c39c2be6e875f8bdc62877a1e50abe 100644
--- a/src/backend/storage/file/Makefile
+++ b/src/backend/storage/file/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/file
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/file/Makefile,v 1.8 1999/12/13 22:33:41 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/file/Makefile,v 1.9 2000/05/29 05:45:03 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = fd.o buffile.o
 
 all: SUBSYS.o
diff --git a/src/backend/storage/ipc/Makefile b/src/backend/storage/ipc/Makefile
index 1aeac4acccecd3b943e587a33bb5381c46e59566..7d9a662055dae400a4cb45be6eb2c0af374b88a0 100644
--- a/src/backend/storage/ipc/Makefile
+++ b/src/backend/storage/ipc/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/ipc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.10 1999/12/13 22:33:45 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.11 2000/05/29 05:45:06 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 # seems to be required 1999/07/22 bjm
 ifeq ($(CPU),alpha)
 ifeq ($(CC), gcc)
diff --git a/src/backend/storage/large_object/Makefile b/src/backend/storage/large_object/Makefile
index d71a51a15afc4322c6bd63b3210a6766b212afc2..fbf66847c2a50cb61a1bc7d113dc5a178015e84d 100644
--- a/src/backend/storage/large_object/Makefile
+++ b/src/backend/storage/large_object/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/large_object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/large_object/Makefile,v 1.8 1999/12/13 22:33:49 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/large_object/Makefile,v 1.9 2000/05/29 05:45:07 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = inv_api.o
 
 all: SUBSYS.o
diff --git a/src/backend/storage/lmgr/Makefile b/src/backend/storage/lmgr/Makefile
index 7d374e523f3b24e5e2806f98ee7ca4acd6a8a5f2..f284d39318a0e16e2f4084e8525d793f6c8bda8c 100644
--- a/src/backend/storage/lmgr/Makefile
+++ b/src/backend/storage/lmgr/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/lmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.12 2000/01/19 02:58:54 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.13 2000/05/29 05:45:08 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = lmgr.o lock.o proc.o
 
 all: SUBSYS.o
diff --git a/src/backend/storage/page/Makefile b/src/backend/storage/page/Makefile
index 3395c62f3f77b3042a1e468e965e30db81892134..14d1780c993567cd62aa23a7b17fe9ba200344cb 100644
--- a/src/backend/storage/page/Makefile
+++ b/src/backend/storage/page/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/page
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/page/Makefile,v 1.8 1999/12/13 22:33:59 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/page/Makefile,v 1.9 2000/05/29 05:45:12 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS =  bufpage.o itemptr.o
 
 all: SUBSYS.o
diff --git a/src/backend/storage/smgr/Makefile b/src/backend/storage/smgr/Makefile
index 3a3617698d1d6a8893a325f0362b9fde47c10663..f68443cd5df6124975887156279f58f2a14b59ff 100644
--- a/src/backend/storage/smgr/Makefile
+++ b/src/backend/storage/smgr/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for storage/smgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/smgr/Makefile,v 1.11 2000/01/19 02:58:55 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/smgr/Makefile,v 1.12 2000/05/29 05:45:14 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = md.o mm.o smgr.o smgrtype.o
 
 all: SUBSYS.o
diff --git a/src/backend/tcop/Makefile b/src/backend/tcop/Makefile
index aaeda91f44f95a5fd83e9b8786a7a108676cf4f3..5fafc75f6917707b055d5d5a654e0991fef54d01 100644
--- a/src/backend/tcop/Makefile
+++ b/src/backend/tcop/Makefile
@@ -4,14 +4,12 @@
 #    Makefile for tcop
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.22 2000/05/28 17:56:04 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.23 2000/05/29 05:45:16 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
-include ../../Makefile.global
-
-CFLAGS+= -I..
+include $(SRCDIR)/Makefile.global
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
@@ -24,17 +22,7 @@ all: SUBSYS.o
 SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
-# The following dependencies are picked up by the make dep, but since 
-# not everyone can do make dep, and these are particularly important
-# dependencies (because they don't even exist until you make them),
-# they are hardcoded here.
-
-utility.o: ../parse.h
-
-../parse.h: 
-	$(MAKE) -C .. parse.h
-
-dep depend: ../parse.h
+depend dep:
 	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 683f057f21266894bba16fc4da457085ba061eb1..f4f291bece36f7edd0d61714d3167a3a05daa8fd 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.155 2000/05/21 02:23:30 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.156 2000/05/29 05:45:16 tgl Exp $
  *
  * NOTES
  *	  this is the "main" module of the postgres backend and
@@ -48,6 +48,7 @@
 #include "nodes/print.h"
 #include "optimizer/cost.h"
 #include "optimizer/planner.h"
+#include "parser/parse.h"
 #include "parser/parser.h"
 #include "rewrite/rewriteHandler.h"
 #include "tcop/fastpath.h"
@@ -58,9 +59,6 @@
 #include "utils/ps_status.h"
 #include "utils/temprel.h"
 #include "utils/trace.h"
-
-#include "../backend/parser/parse.h"
-
 #ifdef MULTIBYTE
 #include "mb/pg_wchar.h"
 #endif
@@ -1452,7 +1450,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
 	if (!IsUnderPostmaster)
 	{
 		puts("\nPOSTGRES backend interactive interface ");
-		puts("$Revision: 1.155 $ $Date: 2000/05/21 02:23:30 $\n");
+		puts("$Revision: 1.156 $ $Date: 2000/05/29 05:45:16 $\n");
 	}
 
 	/*
diff --git a/src/backend/tioga/Makefile b/src/backend/tioga/Makefile
index 7bfdd3064a3027151c05a9cbafd8d55c6b30525f..041593f79acf0d7793586a95af87c35df151c270 100644
--- a/src/backend/tioga/Makefile
+++ b/src/backend/tioga/Makefile
@@ -4,17 +4,13 @@
 #    Makefile for tioga
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/tioga/Attic/Makefile,v 1.6 1999/12/13 22:34:22 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/tioga/Attic/Makefile,v 1.7 2000/05/29 05:45:18 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 OBJS = tgRecipe.o Varray.o
 
 all: SUBSYS.o
@@ -23,7 +19,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) 
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index eba9b13af29671956f2d44deb0dcd366d17208fd..deafee16d3382f9af08c91ddf274387b7fb26e48 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -4,17 +4,13 @@
 #    Makefile for utils
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.11 2000/05/28 17:56:05 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.12 2000/05/29 05:45:18 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include $(SRCDIR)/Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
 all: submake SUBSYS.o
 
 OBJS = fmgrtab.o adt/SUBSYS.o cache/SUBSYS.o error/SUBSYS.o \
diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile
index 8ed27fe89337d6a06443aaf3a03ccb3d8aeebedc..298e15f00009dd6ba0c274de45f796395dc89972 100644
--- a/src/backend/utils/adt/Makefile
+++ b/src/backend/utils/adt/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/adt
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.36 2000/04/08 02:12:54 thomas Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.37 2000/05/29 05:45:20 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 # seems to be required for some date/time stuff 1999/07/22 bjm
 ifeq ($(CPU),alpha)
 ifeq ($(CC), gcc)
diff --git a/src/backend/utils/cache/Makefile b/src/backend/utils/cache/Makefile
index 7f595f68cb9c62ef25485f33eb02c34209458134..eaa4e764d5d0caff6965620d279582ca640e718f 100644
--- a/src/backend/utils/cache/Makefile
+++ b/src/backend/utils/cache/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/cache
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/cache/Makefile,v 1.12 1999/12/13 22:34:38 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/cache/Makefile,v 1.13 2000/05/29 05:45:24 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = catcache.o inval.o rel.o relcache.o syscache.o lsyscache.o \
 	fcache.o temprel.o
 
diff --git a/src/backend/utils/error/Makefile b/src/backend/utils/error/Makefile
index 8893979cb380799e0ab68f07f48e8c9238878662..2313f52aee25f8445d336a1589710f01f34b1c39 100644
--- a/src/backend/utils/error/Makefile
+++ b/src/backend/utils/error/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/error
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/error/Makefile,v 1.7 1999/12/13 22:34:42 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/error/Makefile,v 1.8 2000/05/29 05:45:27 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = assert.o elog.o exc.o excabort.o excid.o format.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/fmgr/Makefile b/src/backend/utils/fmgr/Makefile
index a269dcfee4f81041ad5dc2aa43e6ef2c39152d5b..f08c3fafdd74a576191c65d8991f1d7a1a90a443 100644
--- a/src/backend/utils/fmgr/Makefile
+++ b/src/backend/utils/fmgr/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/fmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/Makefile,v 1.8 1999/12/13 22:34:47 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/Makefile,v 1.9 2000/05/29 05:45:30 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = dfmgr.o fmgr.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/hash/Makefile b/src/backend/utils/hash/Makefile
index 24ca4822be0c293719500d202a811cf1b157331a..282cd2527a597a8fad6ecf903bcd3ae953a2f58a 100644
--- a/src/backend/utils/hash/Makefile
+++ b/src/backend/utils/hash/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/hash
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/hash/Makefile,v 1.7 1999/12/13 22:34:50 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/hash/Makefile,v 1.8 2000/05/29 05:45:30 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = dynahash.o hashfn.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/init/Makefile b/src/backend/utils/init/Makefile
index 656eadaf9f8a9fac787f987d49610acd79cf5a9c..60ee275c6414cbc5aa945f6f523a7a2dd86d8157 100644
--- a/src/backend/utils/init/Makefile
+++ b/src/backend/utils/init/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/init
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.12 2000/01/19 02:58:57 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.13 2000/05/29 05:45:32 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = enbl.o findbe.o globals.o miscinit.o postinit.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/mb/Makefile b/src/backend/utils/mb/Makefile
index 325e8835c085cbc111a81afdc56d51c0001a25ee..456dd6c30c2c1db28047f25122fdf5e0ca9fffe2 100644
--- a/src/backend/utils/mb/Makefile
+++ b/src/backend/utils/mb/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/mb
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.7 2000/01/19 02:58:57 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/mb/Makefile,v 1.8 2000/05/29 05:45:34 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = common.o conv.o mbutils.o wchar.o wstrcmp.o wstrncmp.o variable.o \
        big5.o
 
diff --git a/src/backend/utils/misc/Makefile b/src/backend/utils/misc/Makefile
index 626142d67c938f7e62ff3183073a100b7d8048bb..0afdb0a63bceca1d484badee6dd6762b1e23e358 100644
--- a/src/backend/utils/misc/Makefile
+++ b/src/backend/utils/misc/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/misc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.12 2000/01/19 02:58:58 petere Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.13 2000/05/29 05:45:37 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = database.o superuser.o trace.o 
 
 all: SUBSYS.o
diff --git a/src/backend/utils/mmgr/Makefile b/src/backend/utils/mmgr/Makefile
index 0fa41adff655b15b96dfd7415533307041b325c7..47698172228bebc7e5a04d1341b8059d37e7e2d0 100644
--- a/src/backend/utils/mmgr/Makefile
+++ b/src/backend/utils/mmgr/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/mmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Makefile,v 1.7 1999/12/13 22:35:10 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Makefile,v 1.8 2000/05/29 05:45:40 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = aset.o mcxt.o palloc.o portalmem.o oset.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/sort/Makefile b/src/backend/utils/sort/Makefile
index 2b29bddd37222775ac29ac032b4f67a0754f5fd9..f0e56ace0a811e2d5fc4939f5bb20f2550d04630 100644
--- a/src/backend/utils/sort/Makefile
+++ b/src/backend/utils/sort/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/sort
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/sort/Makefile,v 1.9 1999/12/13 22:35:14 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/sort/Makefile,v 1.10 2000/05/29 05:45:40 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = logtape.o tuplesort.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/time/Makefile b/src/backend/utils/time/Makefile
index 2f8bd354f60814ae683a1a954646b7f0c7b5af9f..d4ee33d5563c6fdc634811f8fec5eed48d5e200c 100644
--- a/src/backend/utils/time/Makefile
+++ b/src/backend/utils/time/Makefile
@@ -4,15 +4,13 @@
 #    Makefile for utils/time
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/time/Makefile,v 1.7 1999/12/13 22:35:21 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/time/Makefile,v 1.8 2000/05/29 05:45:42 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-CFLAGS += -I../..
-
 OBJS = tqual.o
 
 all: SUBSYS.o
diff --git a/src/bin/pg_encoding/Makefile b/src/bin/pg_encoding/Makefile
index ce4f4587767820e41e64f9190bef651c07e68dc5..5db546a9cf186d6808ac696bf2ad79a3c46dfc38 100644
--- a/src/bin/pg_encoding/Makefile
+++ b/src/bin/pg_encoding/Makefile
@@ -6,18 +6,14 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.6 2000/03/31 14:14:32 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.7 2000/05/29 05:45:44 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
-include ../../Makefile.global
-
-# This is a bit of hackery here: pg_encoding uses backend includes and the
-# frontend library.
+include $(SRCDIR)/Makefile.global
 
 OBJS= pg_encoding.o
-CFLAGS:= -I$(SRCDIR)/include $(CFLAGS)
 
 all: submake pg_encoding
 
diff --git a/src/bin/pg_version/Makefile.in b/src/bin/pg_version/Makefile.in
index 64e0a2673a99e7c207ba3f9932d6fb5db669e675..38d67a5e1c50cdccae87ed581ed05a7c23a4c49c 100644
--- a/src/bin/pg_version/Makefile.in
+++ b/src/bin/pg_version/Makefile.in
@@ -7,15 +7,13 @@
 # Portions Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile.in,v 1.8 2000/05/11 17:46:35 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile.in,v 1.9 2000/05/29 05:45:46 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= -I$(SRCDIR)/include
-
 OBJS= pg_version.o $(SRCDIR)/utils/version.o @STRERROR2@
 
 all: pg_version
diff --git a/src/interfaces/libpgtcl/Makefile.in b/src/interfaces/libpgtcl/Makefile.in
index fa766ff5f0be38f2156948f930622bb9866f514b..f516a360a9b6f4ab47b7eb4fe8e579d91a54e85d 100644
--- a/src/interfaces/libpgtcl/Makefile.in
+++ b/src/interfaces/libpgtcl/Makefile.in
@@ -6,7 +6,7 @@
 # Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.39 2000/03/08 01:58:36 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.40 2000/05/29 05:45:48 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -17,9 +17,7 @@ SO_MINOR_VERSION= 1
 SRCDIR= @top_srcdir@
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= -I$(SRCDIR)/backend \
-         -I$(SRCDIR)/include \
-         -I$(LIBPQDIR)
+CFLAGS+= -I$(LIBPQDIR)
 
 ifdef KRBVERS
 CFLAGS+= $(KRBFLAGS)
diff --git a/src/interfaces/libpq++/Makefile.in b/src/interfaces/libpq++/Makefile.in
index dad0c4813ef295de0a0f5f72215e65cd1c7e2b0c..8c217d9df7e225a88b9437f594936add2201e526 100644
--- a/src/interfaces/libpq++/Makefile.in
+++ b/src/interfaces/libpq++/Makefile.in
@@ -6,7 +6,7 @@
 # Copyright (c) 1994, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.24 2000/04/22 22:39:15 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.25 2000/05/29 05:45:50 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -23,9 +23,7 @@ CXXFLAGS=@CXXFLAGS@
 SRCHEADERDIR = $(SRCDIR)/include
 LIBPQHEADERDIR = $(SRCHEADERDIR)/libpq
 
-CXXFLAGS+=   -I$(SRCDIR)/backend \
-             -I$(SRCHEADERDIR) \
-             -I$(LIBPQDIR)
+CXXFLAGS+= -I$(SRCHEADERDIR) -I$(LIBPQDIR)
 
 ifdef KRBVERS
 CXXFLAGS+= $(KRBFLAGS)
diff --git a/src/interfaces/libpq++/examples/Makefile b/src/interfaces/libpq++/examples/Makefile
index 5e277ade32377656d6ac404fdf535a4c64d7fde2..b30588e4c91215a41157b0f54a4a6e3eed2f6b7e 100644
--- a/src/interfaces/libpq++/examples/Makefile
+++ b/src/interfaces/libpq++/examples/Makefile
@@ -15,9 +15,7 @@ LIBPQDIR= /usr/local/pgsql/lib
 #CXXFLAGS= $(CFLAGS) -Wno-error -Wno-unused -Wl,-Bdynamic
 CXXFLAGS= $(CFLAGS)
 
-INCLUDE_OPT= -I$(HEADERDIR)
-
-CXXFLAGS+= $(INCLUDE_OPT)
+CXXFLAGS+= -I$(HEADERDIR)
 
 LDFLAGS+= -L$(LIBPQDIR) -lpq++ 
 
diff --git a/src/pl/plperl/Makefile.PL b/src/pl/plperl/Makefile.PL
index 565e8bbd2888db797e913ab7895431169b3f5e66..a5b6066b084e0673b427252b79dc9913b9509852 100644
--- a/src/pl/plperl/Makefile.PL
+++ b/src/pl/plperl/Makefile.PL
@@ -54,7 +54,7 @@ my $perllib = "-L$Config{archlibexp}/CORE -lperl";
 
 WriteMakefile( 'NAME' => 'plperl', 
 	dynamic_lib => { 'OTHERLDFLAGS' => "$opcode $perllib" } ,
-	INC => '-I$(SRCDIR)/include -I$(SRCDIR)/backend $(PGSQL_INCLUDES)',
+	INC => '-I$(SRCDIR)/include $(PGSQL_INCLUDES)',
 	XS => { 'SPI.xs' => 'SPI.c' },
 	OBJECT => 'plperl.o eloglvl.o SPI.o',
 	);
diff --git a/src/pl/plpgsql/src/Makefile.in b/src/pl/plpgsql/src/Makefile.in
index 63a1af65960cf340cf8e58ff0cdf38f405f4fa72..cd465c0cf67e13806d0fdd615c757962910c6cac 100644
--- a/src/pl/plpgsql/src/Makefile.in
+++ b/src/pl/plpgsql/src/Makefile.in
@@ -4,7 +4,7 @@
 #    Makefile for the plpgsql shared object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.22 2000/04/04 01:47:59 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.23 2000/05/29 05:45:53 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -15,8 +15,6 @@ SO_MINOR_VERSION= 0
 SRCDIR= @top_srcdir@
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= -I$(SRCDIR)/include -I$(SRCDIR)/backend
-
 # If using flex, ask for a case-insensitive, lex-compatible lexer.
 ifneq (,$(findstring flex,$(LEX)))
 LFLAGS+= -i -l
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile
index 8400d364f362fbae9af18ee809752d04b21a30a0..b664d8a791869495f0ae37daf489b0cf113a24e4 100644
--- a/src/pl/tcl/Makefile
+++ b/src/pl/tcl/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for the pltcl shared object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.14 2000/05/23 02:12:44 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.15 2000/05/29 05:45:54 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -70,7 +70,7 @@ CFLAGS= $(TCL_CFLAGS_OPTIMIZE)
 
 CFLAGS+= $(TCL_SHLIB_CFLAGS) $(TCL_DEFS)
 
-CFLAGS+= -I$(SRCDIR)/include -I$(SRCDIR)/backend $(PGSQL_INCLUDES)
+CFLAGS+= -I$(SRCDIR)/include $(PGSQL_INCLUDES)
         
 #
 # Uncomment the following to enable the unknown command lookup
diff --git a/src/test/regress/GNUmakefile.in b/src/test/regress/GNUmakefile.in
index cdb95c1fb6e35368dbd6a866e94dd45ad822bd60..88b207ebcef5ca721af1657fcf397e0a38f94c9f 100644
--- a/src/test/regress/GNUmakefile.in
+++ b/src/test/regress/GNUmakefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/test/regress/Attic/GNUmakefile.in,v 1.1 2000/01/09 07:53:58 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/test/regress/Attic/GNUmakefile.in,v 1.2 2000/05/29 05:45:55 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -18,7 +18,7 @@ CONTRIB= $(SRCDIR)/../contrib
 
 HOST= @host@
 
-CFLAGS+= -I$(LIBPQDIR) -I$(SRCDIR)/include $(CFLAGS_SL)
+CFLAGS+= -I$(LIBPQDIR) $(CFLAGS_SL)
 
 LDADD+= -L$(LIBPQDIR) -lpq
         
diff --git a/src/tutorial/Makefile b/src/tutorial/Makefile
index 9ba5096f0a16f57af5508c1a9623ff427ce800db..f3fd6b24bac55cb73acce4d63363f794ac32d692 100644
--- a/src/tutorial/Makefile
+++ b/src/tutorial/Makefile
@@ -4,14 +4,14 @@
 #    Makefile for tutorial
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.9 2000/03/28 02:49:19 tgl Exp $
+#    $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.10 2000/05/29 05:45:56 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ..
 include $(SRCDIR)/Makefile.global
 
-CFLAGS+= -I$(SRCDIR)/include $(CFLAGS_SL)
+CFLAGS+= $(CFLAGS_SL)
 
 #
 # DLOBJS is the dynamically-loaded object files.  The "funcs" queries