From 1e801a8f16ae0b308ac3aea88dddcb676f412580 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 6 Apr 1998 00:32:26 +0000
Subject: [PATCH] Hi,

Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
---
 src/Makefile.global.in                    | 24 +-------------
 src/backend/access/common/Makefile        | 11 +++----
 src/backend/access/gist/Makefile          |  8 ++---
 src/backend/access/hash/Makefile          |  8 ++---
 src/backend/access/heap/Makefile          |  8 ++---
 src/backend/access/index/Makefile         |  8 ++---
 src/backend/access/nbtree/Makefile        |  8 ++---
 src/backend/access/rtree/Makefile         |  8 ++---
 src/backend/access/transam/Makefile       |  8 ++---
 src/backend/bootstrap/Makefile            | 10 +++---
 src/backend/catalog/Makefile              |  8 ++---
 src/backend/catalog/genbki.sh             | 24 +++++++++-----
 src/backend/commands/Makefile             |  8 ++---
 src/backend/executor/Makefile             |  8 ++---
 src/backend/libpq/Makefile                |  8 ++---
 src/backend/main/Makefile                 |  8 ++---
 src/backend/nodes/Makefile                |  8 ++---
 src/backend/optimizer/Makefile            | 24 ++++----------
 src/backend/optimizer/geqo/Makefile       |  9 ++---
 src/backend/optimizer/path/Makefile       |  8 ++---
 src/backend/optimizer/plan/Makefile       |  8 ++---
 src/backend/optimizer/prep/Makefile       |  8 ++---
 src/backend/optimizer/util/Makefile       |  8 ++---
 src/backend/parser/Makefile               | 10 +++---
 src/backend/port/Makefile.in              |  8 ++---
 src/backend/postmaster/Makefile           |  8 ++---
 src/backend/regex/Makefile                | 10 +++---
 src/backend/rewrite/Makefile              |  8 ++---
 src/backend/storage/Makefile              | 29 ++++------------
 src/backend/storage/buffer/Makefile       |  8 ++---
 src/backend/storage/file/Makefile         |  8 ++---
 src/backend/storage/ipc/Makefile          |  8 ++---
 src/backend/storage/large_object/Makefile |  8 ++---
 src/backend/storage/lmgr/Makefile         |  8 ++---
 src/backend/storage/page/Makefile         |  8 ++---
 src/backend/storage/smgr/Makefile         |  8 ++---
 src/backend/tcop/Makefile                 | 10 +++---
 src/backend/utils/Makefile                | 40 ++++-------------------
 src/backend/utils/adt/Makefile            |  7 ++--
 src/backend/utils/cache/Makefile          |  8 ++---
 src/backend/utils/error/Makefile          |  8 ++---
 src/backend/utils/fmgr/Makefile           | 16 ++-------
 src/backend/utils/hash/Makefile           |  8 ++---
 src/backend/utils/init/Makefile           |  8 ++---
 src/backend/utils/misc/Makefile           |  8 ++---
 src/backend/utils/mmgr/Makefile           |  8 ++---
 src/backend/utils/sort/Makefile           |  8 ++---
 src/backend/utils/time/Makefile           |  8 ++---
 src/bin/Makefile                          | 29 +++++-----------
 src/bin/cleardbdir/Makefile               |  4 +--
 src/bin/createdb/Makefile                 |  4 +--
 src/bin/createuser/Makefile               |  4 +--
 src/bin/destroydb/Makefile                |  4 +--
 src/bin/destroyuser/Makefile              |  4 +--
 src/bin/initdb/Makefile                   | 11 ++-----
 src/bin/initdb/initdb.sh                  |  9 +----
 src/bin/initlocation/Makefile             |  4 +--
 src/bin/ipcclean/Makefile                 |  4 +--
 src/bin/pg_dump/Makefile.in               |  4 +--
 src/bin/pg_id/Makefile                    |  4 +--
 src/bin/pg_passwd/Makefile                |  2 +-
 src/bin/pg_version/Makefile.in            |  4 +--
 src/bin/pgtclsh/Makefile                  |  5 ++-
 src/bin/psql/Makefile.in                  |  4 +--
 src/interfaces/ecpg/Makefile              |  2 +-
 src/interfaces/ecpg/include/Makefile      |  2 ++
 src/interfaces/ecpg/lib/Makefile.in       |  2 ++
 src/interfaces/ecpg/preproc/Makefile      |  3 ++
 src/interfaces/ecpg/test/Makefile         |  2 ++
 src/interfaces/jdbc/Makefile              |  4 ++-
 src/interfaces/libpgtcl/Makefile.in       |  4 ++-
 src/interfaces/libpq++/Makefile           | 12 +++----
 src/interfaces/libpq/Makefile.in          |  4 +--
 src/lextest/Makefile                      |  2 ++
 src/makefiles/Makefile.linux              |  6 ----
 src/man/Makefile                          | 18 +++++-----
 src/pl/tcl/Makefile                       |  3 +-
 src/template/linux-elf                    |  4 +--
 src/template/linux-elf-sparc              |  2 +-
 src/template/linuxalpha                   |  2 +-
 src/utils/Makefile                        |  4 +--
 81 files changed, 250 insertions(+), 430 deletions(-)

diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 9c8de9d2df0..98e2d042c5b 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.37 1998/03/23 06:01:47 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.38 1998/04/06 00:20:33 momjian Exp $
 #
 # NOTES
 #    Essentially all Postgres make files include this file and use the 
@@ -44,11 +44,6 @@
 # installation.  
 # of the port.
 #
-# Ignore LINUX_ELF if you're not using Linux.  But if you are, and you're
-# compiling to a.out (which means you're using the dld dynamic loading 
-# library), set LINUX_ELF to null in Makefile.custom.
-LINUX_ELF= true
-#
 # Ignore BSD_SHLIB if you're not using one of the BSD ports.  But if you
 # are, and it's one that doesn't have shared libraries (NetBSD/vax is an
 # example of this), set BSD_SHLIB to null in Makefile.custom.
@@ -85,23 +80,6 @@ POSTDOCDIR= $(POSTGRESDIR)/doc
 # Where the header files necessary to build frontend programs get installed.
 HEADERDIR= $(POSTGRESDIR)/include
 
-# NAMEDATALEN is the max length for system identifiers (e.g. table names,
-# attribute names, function names, etc.)
-#
-# These MUST be set here.  DO NOT COMMENT THESE OUT
-# Setting these too high will result in excess space usage for system catalogs
-# Setting them too low will make the system unusable.
-# values between 16 and 64 that are multiples of four are recommended.
-# 
-# NOTE also that databases with different NAMEDATALEN's cannot interoperate!
-#
-# THERE ARE REDUNDANT DEFINITIONS OF THESE VALUES IN config.h.
-# Don't change anything here without changing it there too.
-
-NAMEDATALEN= 32
-# OIDNAMELEN should be set to NAMEDATALEN + sizeof(Oid)
-OIDNAMELEN= 36
- 
 ##############################################################################
 #
 # FEATURES 
diff --git a/src/backend/access/common/Makefile b/src/backend/access/common/Makefile
index 594ec514db0..73b1b3ea82e 100644
--- a/src/backend/access/common/Makefile
+++ b/src/backend/access/common/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/common
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.9 1998/01/15 19:41:42 pgsql Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.10 1998/04/06 00:20:44 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT) 
+CFLAGS+=-I../..
 
 OBJS = heaptuple.o heapvalid.o indextuple.o indexvalid.o printtup.o \
        scankey.o tupdesc.o  
@@ -28,8 +26,8 @@ heaptuple.o heapvalid.o tupdesc.o: ../../fmgr.h
 ../../fmgr.h:
 	$(MAKE) -C ../.. fmgr.h
 
-dep: ../../fmgr.h
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+dep depend: ../../fmgr.h
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS)
@@ -37,4 +35,3 @@ clean:
 ifeq (depend,$(wildcard depend))
 include depend
 endif
-
diff --git a/src/backend/access/gist/Makefile b/src/backend/access/gist/Makefile
index 62be5d4d1cb..bb93730d471 100644
--- a/src/backend/access/gist/Makefile
+++ b/src/backend/access/gist/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/gist
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/gist/Makefile,v 1.5 1997/12/20 00:22:16 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/gist/Makefile,v 1.6 1998/04/06 00:20:49 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = gist.o gistget.o gistscan.o giststrat.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/hash/Makefile b/src/backend/access/hash/Makefile
index 798cf54ab41..9f65126dcc4 100644
--- a/src/backend/access/hash/Makefile
+++ b/src/backend/access/hash/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/hash
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/hash/Makefile,v 1.5 1997/12/20 00:22:31 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/hash/Makefile,v 1.6 1998/04/06 00:20:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = hash.o hashfunc.o hashinsert.o hashovfl.o hashpage.o hashscan.o \
        hashsearch.o hashstrat.o hashutil.o
@@ -24,7 +22,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/heap/Makefile b/src/backend/access/heap/Makefile
index eaa818fbef6..b876c6099ea 100644
--- a/src/backend/access/heap/Makefile
+++ b/src/backend/access/heap/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/heap
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.5 1997/12/20 00:22:39 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/heap/Makefile,v 1.6 1998/04/06 00:21:09 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = heapam.o hio.o stats.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/index/Makefile b/src/backend/access/index/Makefile
index a1978a660a7..c57c4d52372 100644
--- a/src/backend/access/index/Makefile
+++ b/src/backend/access/index/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/index
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/index/Makefile,v 1.5 1997/12/20 00:22:47 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/index/Makefile,v 1.6 1998/04/06 00:21:24 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = genam.o indexam.o istrat.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/nbtree/Makefile b/src/backend/access/nbtree/Makefile
index b6a1804ba26..b0ad3f36706 100644
--- a/src/backend/access/nbtree/Makefile
+++ b/src/backend/access/nbtree/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/nbtree
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/nbtree/Makefile,v 1.5 1997/12/20 00:22:54 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/nbtree/Makefile,v 1.6 1998/04/06 00:21:34 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = nbtcompare.o nbtinsert.o nbtpage.o nbtree.o nbtscan.o nbtsearch.o \
        nbtstrat.o nbtutils.o nbtsort.o
@@ -24,7 +22,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/rtree/Makefile b/src/backend/access/rtree/Makefile
index 146ca76f15a..9bb5fdfa0f7 100644
--- a/src/backend/access/rtree/Makefile
+++ b/src/backend/access/rtree/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/rtree
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/Makefile,v 1.5 1997/12/20 00:23:00 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/Makefile,v 1.6 1998/04/06 00:21:41 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = rtget.o rtproc.o rtree.o rtscan.o rtstrat.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/access/transam/Makefile b/src/backend/access/transam/Makefile
index 4fb565e9997..69d507b3d96 100644
--- a/src/backend/access/transam/Makefile
+++ b/src/backend/access/transam/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for access/transam
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.5 1997/12/20 00:23:09 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.6 1998/04/06 00:21:52 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../.. 
 
 OBJS = transam.o transsup.o varsup.o xact.o xid.o 
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/bootstrap/Makefile b/src/backend/bootstrap/Makefile
index 8835803b733..b172c4d267b 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.12 1997/12/20 00:23:19 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.13 1998/04/06 00:22:02 momjian Exp $
 #
 #
 # We must build bootparse.c and bootscanner.c with yacc and lex and sed,
@@ -21,9 +21,7 @@
 SRCDIR= ../..
 include ../../Makefile.global
 
-INCLUDE_OPT= -I.. 
-
-CFLAGS+= $(INCLUDE_OPT)  
+CFLAGS += -I..
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
@@ -65,8 +63,8 @@ clean:
 
 # This is unusual:  We actually have to build some of the parts before
 # we know what the header file dependencies are.  
-dep: bootparse.c bootscanner.c bootstrap_tokens.h
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 ifeq (depend,$(wildcard depend))
 include depend
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 51fd03d74c8..f13fa5f92ab 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for catalog
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.9 1998/02/25 13:05:55 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.10 1998/04/06 00:22:13 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+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
@@ -47,7 +45,7 @@ local1_template1.bki.source: $(GENBKI) $(LOCALBKI_SRCS)
 	sh $(SHOPTS) $(GENBKI) $(BKIOPTS) $(LOCALBKI_SRCS) > $@ 2>local1_template1.description
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) global1.bki.source local1_template1.bki.source \
diff --git a/src/backend/catalog/genbki.sh b/src/backend/catalog/genbki.sh
index ef43d5d242b..c6b0cf0a289 100644
--- a/src/backend/catalog/genbki.sh
+++ b/src/backend/catalog/genbki.sh
@@ -10,7 +10,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.9 1997/11/13 03:22:20 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.10 1998/04/06 00:22:16 momjian Exp $
 #
 # NOTES
 #    non-essential whitespace is removed from the generated file.
@@ -52,6 +52,10 @@ while test $x -le $numargs ; do
     shift
 done
 
+# Get NAMEDATALEN and OIDNAMELEN from postgres_ext.h
+NAMEDATALEN=`grep '#define.*NAMEDATALEN' ../../include/postgres_ext.h | awk '{ print $3 }'`
+OIDNAMELEN=`grep '#define.*OIDNAMELEN' ../../include/postgres_ext.h | awk '{ print $3 }'`
+
 # ----------------
 # 	strip comments and trash from .h before we generate
 #	the .bki file...
@@ -68,14 +72,16 @@ sed -e 's;/\*.*\*/;;g' \
     -e 's;\*/;\
 */\
 ;g' | # we must run a new sed here to see the newlines we added
-sed -e 's/;[ 	]*$//g' \
-    -e 's/^[ 	]*//' \
-    -e 's/[ 	]Oid/\ oid/g' \
-    -e 's/[ 	]NameData/\ name/g' \
-    -e 's/^Oid/oid/g' \
-    -e 's/^NameData/\name/g' \
-    -e 's/(NameData/(name/g' \
-    -e 's/(Oid/(oid/g' | \
+sed -e "s/;[ 	]*$//g" \
+    -e "s/^[ 	]*//" \
+    -e "s/[ 	]Oid/\ oid/g" \
+    -e "s/[ 	]NameData/\ name/g" \
+    -e "s/^Oid/oid/g" \
+    -e "s/^NameData/\name/g" \
+    -e "s/(NameData/(name/g" \
+    -e "s/(Oid/(oid/g" \
+	-e "s/NAMEDATALEN/$NAMEDATALEN/g" \
+	-e "s/OIDNAMELEN/$OIDNAMELEN/g" | \
 awk '
 # ----------------
 #	now use awk to process remaining .h file..
diff --git a/src/backend/commands/Makefile b/src/backend/commands/Makefile
index a0ed9594379..7e4fe415c3b 100644
--- a/src/backend/commands/Makefile
+++ b/src/backend/commands/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for commands
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.11 1998/01/05 18:42:45 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.12 1998/04/06 00:22:19 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = async.o creatinh.o command.o copy.o defind.o define.o \
        remove.o rename.o vacuum.o version.o view.o cluster.o \
@@ -26,7 +24,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/executor/Makefile b/src/backend/executor/Makefile
index 9ae3cfc3518..59339d14733 100644
--- a/src/backend/executor/Makefile
+++ b/src/backend/executor/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for executor
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.6 1998/02/13 03:26:35 vadim Exp $
+#    $Header: /cvsroot/pgsql/src/backend/executor/Makefile,v 1.7 1998/04/06 00:22:26 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = execAmi.o execFlatten.o execJunk.o execMain.o \
        execProcnode.o execQual.o execScan.o execTuples.o \
@@ -28,7 +26,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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 1659ad7ea1c..a608044facf 100644
--- a/src/backend/libpq/Makefile
+++ b/src/backend/libpq/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for libpq subsystem (backend half of libpq interface)
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.10 1997/12/20 00:23:57 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/libpq/Makefile,v 1.11 1998/04/06 00:22:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 # kerberos flags
 ifdef KRBVERS
@@ -36,7 +34,7 @@ be-dumpdata.o be-pqexec.o: ../fmgr.h
 	$(MAKE) -C .. fmgr.h
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) 
diff --git a/src/backend/main/Makefile b/src/backend/main/Makefile
index 2254c9b44ae..a01b1092ac3 100644
--- a/src/backend/main/Makefile
+++ b/src/backend/main/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for main
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/main/Makefile,v 1.4 1997/12/20 00:24:03 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/main/Makefile,v 1.5 1998/04/06 00:22:51 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = main.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/nodes/Makefile b/src/backend/nodes/Makefile
index 70a298ced2a..7e34521f6bd 100644
--- a/src/backend/nodes/Makefile
+++ b/src/backend/nodes/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for nodes
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/nodes/Makefile,v 1.5 1997/12/20 00:24:08 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/nodes/Makefile,v 1.6 1998/04/06 00:23:00 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = nodeFuncs.o nodes.o list.o \
        copyfuncs.o equalfuncs.o makefuncs.o outfuncs.o readfuncs.o \
@@ -25,7 +23,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/optimizer/Makefile b/src/backend/optimizer/Makefile
index 40c92028d9d..ce5b8ac8a1a 100644
--- a/src/backend/optimizer/Makefile
+++ b/src/backend/optimizer/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for optimizer
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/Makefile,v 1.4 1997/06/11 01:12:55 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/Makefile,v 1.5 1998/04/06 00:23:04 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -15,28 +15,18 @@ all: submake SUBSYS.o
 
 OBJS = path/SUBSYS.o plan/SUBSYS.o prep/SUBSYS.o util/SUBSYS.o geqo/SUBSYS.o
 
+DIRS = path plan prep util geqo
+
 SUBSYS.o: $(OBJS)
 	$(LD) -r -o SUBSYS.o $(OBJS)
 
-.PHONY: submake clean
+.PHONY: submake clean dep depend
 submake:
-	$(MAKE) -C path SUBSYS.o
-	$(MAKE) -C plan SUBSYS.o
-	$(MAKE) -C prep SUBSYS.o
-	$(MAKE) -C util SUBSYS.o
-	$(MAKE) -C geqo SUBSYS.o
+	for i in $(DIRS); do $(MAKE) -C $$i SUBSYS.o; done
 
 clean:
 	rm -f SUBSYS.o
-	$(MAKE) -C path clean
-	$(MAKE) -C plan clean
-	$(MAKE) -C prep clean
-	$(MAKE) -C util clean
-	$(MAKE) -C geqo clean
+	for i in $(DIRS); do $(MAKE) -C $$i clean; done
 
 .DEFAULT: 
-	$(MAKE) -C path $@
-	$(MAKE) -C plan $@
-	$(MAKE) -C prep $@
-	$(MAKE) -C util $@
-	$(MAKE) -C geqo $@
+	for i in $(DIRS); do $(MAKE) -C $$i $@; done
diff --git a/src/backend/optimizer/geqo/Makefile b/src/backend/optimizer/geqo/Makefile
index 35e76fb4d57..9a2cef66020 100644
--- a/src/backend/optimizer/geqo/Makefile
+++ b/src/backend/optimizer/geqo/Makefile
@@ -5,22 +5,19 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Id: Makefile,v 1.9 1997/12/20 00:24:17 scrappy Exp $
+# $Id: Makefile,v 1.10 1998/04/06 00:23:07 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
 endif
 
-
 OBJS =	geqo_copy.o geqo_eval.o geqo_main.o geqo_misc.o \
 	geqo_params.o geqo_paths.o geqo_pool.o geqo_recombination.o \
 	geqo_selection.o \
@@ -34,7 +31,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/optimizer/path/Makefile b/src/backend/optimizer/path/Makefile
index 030de18ac82..88525cdfeac 100644
--- a/src/backend/optimizer/path/Makefile
+++ b/src/backend/optimizer/path/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for optimizer/path
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Makefile,v 1.5 1997/12/20 00:24:23 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/path/Makefile,v 1.6 1998/04/06 00:23:17 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = allpaths.o clausesel.o costsize.o hashutils.o indxpath.o \
        joinpath.o joinrels.o joinutils.o mergeutils.o orindxpath.o \
@@ -27,7 +25,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/optimizer/plan/Makefile b/src/backend/optimizer/plan/Makefile
index 19690ae2081..5164f1c2a9f 100644
--- a/src/backend/optimizer/plan/Makefile
+++ b/src/backend/optimizer/plan/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for optimizer/plan
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/plan/Makefile,v 1.6 1998/02/13 03:36:51 vadim Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/plan/Makefile,v 1.7 1998/04/06 00:23:31 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = createplan.o initsplan.o planmain.o planner.o setrefs.o subselect.o
 
@@ -25,7 +23,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/optimizer/prep/Makefile b/src/backend/optimizer/prep/Makefile
index 284a1e17983..6255a853d49 100644
--- a/src/backend/optimizer/prep/Makefile
+++ b/src/backend/optimizer/prep/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for optimizer/prep
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.6 1997/12/20 00:24:38 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.7 1998/04/06 00:23:48 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = prepqual.o preptlist.o prepunion.o
 
@@ -25,7 +23,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/optimizer/util/Makefile b/src/backend/optimizer/util/Makefile
index dd8511c715b..fcd2e6444ad 100644
--- a/src/backend/optimizer/util/Makefile
+++ b/src/backend/optimizer/util/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for optimizer/util
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.5 1997/12/20 00:24:45 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/optimizer/util/Makefile,v 1.6 1998/04/06 00:23:55 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = clauseinfo.o clauses.o indexnode.o internal.o plancat.o \
        joininfo.o keys.o ordering.o pathnode.o relnode.o tlist.o var.o
@@ -26,7 +24,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/parser/Makefile b/src/backend/parser/Makefile
index 6f4fbe16a13..d1d5885a5bb 100644
--- a/src/backend/parser/Makefile
+++ b/src/backend/parser/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for parser
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.14 1998/02/18 07:37:05 thomas Exp $
+#    $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.15 1998/04/06 00:24:02 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include ../../Makefile.global
 
-INCLUDE_OPT= -I.. 
-
-CFLAGS+= $(INCLUDE_OPT)
+CFLAGS += -I..
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
@@ -47,8 +45,8 @@ analyze.o keywords.o scan.o: parse.h
 
 # This is unusual:  We actually have to build some of the parts before
 # we know what the header file dependencies are.  
-dep: gram.c scan.c
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+dep depend: gram.c scan.c
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 # Remove scan.c from the clean since we want to avoid rebuilding when using
 # the original source distribution. This should help Solaris machines whose
diff --git a/src/backend/port/Makefile.in b/src/backend/port/Makefile.in
index 9a442dba38a..b3f7f5b7b4d 100644
--- a/src/backend/port/Makefile.in
+++ b/src/backend/port/Makefile.in
@@ -13,16 +13,14 @@
 # be converted to Method 2.  
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.15 1998/02/24 06:04:30 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.16 1998/04/06 00:24:10 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR=../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I..
-
-CFLAGS+= ${INCLUDE_OPT}
+CFLAGS+= -I..
 
 OBJS = dynloader.o @INET_ATON@ @STRERROR@ @MISSING_RANDOM@ @SRANDOM@
 OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @STRCASECMP@ @STRDUP@ @TAS@ @ISINF@
@@ -38,7 +36,7 @@ distclean clean:
 	rm -f SUBSYS.o $(OBJS)
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 ifeq (depend,$(wildcard depend))
 include depend
diff --git a/src/backend/postmaster/Makefile b/src/backend/postmaster/Makefile
index 8269ad5603f..3cb191b9a08 100644
--- a/src/backend/postmaster/Makefile
+++ b/src/backend/postmaster/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for postmaster
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.7 1997/12/20 00:26:52 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.8 1998/04/06 00:24:26 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = postmaster.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/regex/Makefile b/src/backend/regex/Makefile
index 6f080cfcb51..42f635aaeb4 100644
--- a/src/backend/regex/Makefile
+++ b/src/backend/regex/Makefile
@@ -4,17 +4,15 @@
 #    Makefile for regex
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.5 1998/03/15 07:38:14 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/regex/Makefile,v 1.6 1998/04/06 00:24:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-CFLAGS+=-DPOSIX_MISTAKE 
+CFLAGS += -I..
+CFLAGS += -DPOSIX_MISTAKE 
 
 OBJS = regcomp.o regerror.o regexec.o regfree.o
 ifdef MB
@@ -28,7 +26,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/rewrite/Makefile b/src/backend/rewrite/Makefile
index 3fc46523229..cba2474b8bb 100644
--- a/src/backend/rewrite/Makefile
+++ b/src/backend/rewrite/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for rewrite
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/rewrite/Makefile,v 1.5 1997/12/20 00:27:05 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/rewrite/Makefile,v 1.6 1998/04/06 00:24:49 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../..
 include ../../Makefile.global
 
-INCLUDE_OPT = -I.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I..
 
 OBJS = rewriteRemove.o rewriteDefine.o \
        rewriteHandler.o rewriteManip.o rewriteSupport.o locks.o
@@ -24,7 +22,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/Makefile b/src/backend/storage/Makefile
index 1fb7883251d..4ea56a9769e 100644
--- a/src/backend/storage/Makefile
+++ b/src/backend/storage/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for the storage manager subsystem
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/Makefile,v 1.3 1997/06/11 01:13:10 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/Makefile,v 1.4 1998/04/06 00:24:53 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -16,36 +16,19 @@ all: submake SUBSYS.o
 OBJS = buffer/SUBSYS.o file/SUBSYS.o ipc/SUBSYS.o large_object/SUBSYS.o \
        lmgr/SUBSYS.o page/SUBSYS.o smgr/SUBSYS.o
 
+DIRS = buffer file ipc large_object lmgr page smgr
+
 SUBSYS.o: $(OBJS)
 	$(LD) -r -o SUBSYS.o $(OBJS)
 
 .PHONY: submake clean dep
 
 submake:
-	$(MAKE) -C buffer  SUBSYS.o
-	$(MAKE) -C file    SUBSYS.o
-	$(MAKE) -C ipc     SUBSYS.o
-	$(MAKE) -C large_object SUBSYS.o
-	$(MAKE) -C lmgr    SUBSYS.o
-	$(MAKE) -C page    SUBSYS.o
-	$(MAKE) -C smgr    SUBSYS.o
+	for i in $(DIRS); do $(MAKE) -C $$i SUBSYS.o; done
 
 clean:
 	rm -f SUBSYS.o
-	$(MAKE) -C buffer   clean
-	$(MAKE) -C file     clean
-	$(MAKE) -C ipc      clean
-	$(MAKE) -C large_object clean
-	$(MAKE) -C lmgr     clean
-	$(MAKE) -C page     clean
-	$(MAKE) -C smgr     clean
+	for i in $(DIRS); do $(MAKE) -C $$i clean; done
 
 .DEFAULT: 
-	$(MAKE) -C buffer   $@
-	$(MAKE) -C file     $@
-	$(MAKE) -C ipc      $@
-	$(MAKE) -C large_object $@
-	$(MAKE) -C lmgr     $@
-	$(MAKE) -C page     $@
-	$(MAKE) -C smgr     $@
-
+	for i in $(DIRS); do $(MAKE) -C $$i $@; done
diff --git a/src/backend/storage/buffer/Makefile b/src/backend/storage/buffer/Makefile
index 177621a925a..1a926a19ac1 100644
--- a/src/backend/storage/buffer/Makefile
+++ b/src/backend/storage/buffer/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/buffer
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.6 1997/12/30 04:01:25 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/buffer/Makefile,v 1.7 1998/04/06 00:24:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o s_lock.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/file/Makefile b/src/backend/storage/file/Makefile
index 6d9afc0e1db..9f321ff57fb 100644
--- a/src/backend/storage/file/Makefile
+++ b/src/backend/storage/file/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/file
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/file/Makefile,v 1.4 1997/12/20 00:27:17 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/file/Makefile,v 1.5 1998/04/06 00:25:05 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = fd.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/ipc/Makefile b/src/backend/storage/ipc/Makefile
index 473306790e2..8bd303c0a62 100644
--- a/src/backend/storage/ipc/Makefile
+++ b/src/backend/storage/ipc/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/ipc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.6 1997/12/20 00:27:25 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/ipc/Makefile,v 1.7 1998/04/06 00:25:14 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = ipc.o ipci.o shmem.o shmqueue.o sinval.o \
        sinvaladt.o spin.o
@@ -24,7 +22,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/large_object/Makefile b/src/backend/storage/large_object/Makefile
index c3e569a3b54..ae6bb06b6a9 100644
--- a/src/backend/storage/large_object/Makefile
+++ b/src/backend/storage/large_object/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/large_object
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/large_object/Makefile,v 1.5 1997/12/20 00:27:35 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/large_object/Makefile,v 1.6 1998/04/06 00:25:30 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = inv_api.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/lmgr/Makefile b/src/backend/storage/lmgr/Makefile
index d99c60c79ee..be70c7234a0 100644
--- a/src/backend/storage/lmgr/Makefile
+++ b/src/backend/storage/lmgr/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/lmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.5 1997/12/20 00:27:44 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Makefile,v 1.6 1998/04/06 00:25:43 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = lmgr.o lock.o multi.o proc.o single.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/page/Makefile b/src/backend/storage/page/Makefile
index 9abb56083f9..7d2eeada60e 100644
--- a/src/backend/storage/page/Makefile
+++ b/src/backend/storage/page/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/page
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/page/Makefile,v 1.5 1997/12/20 00:27:50 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/page/Makefile,v 1.6 1998/04/06 00:25:50 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS =  bufpage.o itemptr.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/storage/smgr/Makefile b/src/backend/storage/smgr/Makefile
index 3e443226681..ba3278d62da 100644
--- a/src/backend/storage/smgr/Makefile
+++ b/src/backend/storage/smgr/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for storage/smgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/storage/smgr/Makefile,v 1.5 1997/12/20 00:27:56 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/storage/smgr/Makefile,v 1.6 1998/04/06 00:25:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = md.o mm.o smgr.o smgrtype.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/tcop/Makefile b/src/backend/tcop/Makefile
index 908160fae1c..45cddf43aaa 100644
--- a/src/backend/tcop/Makefile
+++ b/src/backend/tcop/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for tcop
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.15 1998/01/05 18:42:59 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.16 1998/04/06 00:26:05 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include ../../Makefile.global
 
-INCLUDE_OPT= -I.. 
-
-CFLAGS+= $(INCLUDE_OPT) 
+CFLAGS+= -I..
 
 ifeq ($(CC), gcc)
 CFLAGS+= -Wno-error
@@ -42,8 +40,8 @@ postgres.o: ../fmgr.h
 ../fmgr.h: 
 	$(MAKE) -C .. fmgr.h
 
-dep: ../parse.h ../fmgr.h
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+dep depend: ../parse.h ../fmgr.h
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f SUBSYS.o $(OBJS) 
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index 3f2efbaa9bb..887c7f0324a 100644
--- a/src/backend/utils/Makefile
+++ b/src/backend/utils/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for utils
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.5 1997/12/20 00:28:17 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.6 1998/04/06 00:26:13 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -21,21 +21,14 @@ OBJS = fmgrtab.o adt/SUBSYS.o cache/SUBSYS.o error/SUBSYS.o \
        fmgr/SUBSYS.o hash/SUBSYS.o init/SUBSYS.o misc/SUBSYS.o mmgr/SUBSYS.o \
        sort/SUBSYS.o time/SUBSYS.o
 
+DIRS = adt cache error fmgr hash init misc mmgr sort time
+
 SUBSYS.o: $(OBJS) 
 	$(LD) -r -o SUBSYS.o $(OBJS)
 
 .PHONY: submake clean dep
 submake:
-	$(MAKE) -C adt SUBSYS.o
-	$(MAKE) -C cache SUBSYS.o
-	$(MAKE) -C error SUBSYS.o
-	$(MAKE) -C fmgr SUBSYS.o
-	$(MAKE) -C hash SUBSYS.o
-	$(MAKE) -C init SUBSYS.o
-	$(MAKE) -C misc SUBSYS.o
-	$(MAKE) -C mmgr SUBSYS.o
-	$(MAKE) -C sort SUBSYS.o
-	$(MAKE) -C time SUBSYS.o
+	for i in $(DIRS); do $(MAKE) -C $$i SUBSYS.o; done
 
 fmgrtab.o: ../fmgr.h
 
@@ -47,29 +40,10 @@ fmgr.h fmgrtab.c: ./Gen_fmgrtab.sh ../../include/catalog/pg_proc.h
 
 clean:
 	rm -f SUBSYS.o fmgr.h fmgrtab.o fmgrtab.c
-	$(MAKE) -C adt   clean 
-	$(MAKE) -C cache clean 
-	$(MAKE) -C error clean 
-	$(MAKE) -C fmgr  clean 
-	$(MAKE) -C hash  clean 
-	$(MAKE) -C init  clean 
-	$(MAKE) -C misc  clean 
-	$(MAKE) -C mmgr  clean 
-	$(MAKE) -C sort  clean 
-	$(MAKE) -C time  clean 
+	for i in $(DIRS); do $(MAKE) -C $$i clean; done
 
-dep: fmgr.h fmgrtab.c
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
-	$(MAKE) -C adt   dep 
-	$(MAKE) -C cache dep 
-	$(MAKE) -C error dep 
-	$(MAKE) -C fmgr  dep 
-	$(MAKE) -C hash  dep 
-	$(MAKE) -C init  dep 
-	$(MAKE) -C misc  dep 
-	$(MAKE) -C mmgr  dep 
-	$(MAKE) -C sort  dep 
-	$(MAKE) -C time  dep 
+dep depend: fmgr.h fmgrtab.c
+	for i in $(DIRS); do $(MAKE) -C $$i depend; done
 
 ifeq (depend,$(wildcard depend))
 include depend
diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile
index 75cc755f7cc..cd338b34bf6 100644
--- a/src/backend/utils/adt/Makefile
+++ b/src/backend/utils/adt/Makefile
@@ -4,16 +4,15 @@
 #    Makefile for utils/adt
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.11 1998/03/15 07:38:42 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.12 1998/04/06 00:26:19 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
+CFLAGS += -I../..
 
-CFLAGS+=$(INCLUDE_OPT)
 ifdef MB
 CFLAGS+=-DMB=$(MB)
 endif
@@ -31,7 +30,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/cache/Makefile b/src/backend/utils/cache/Makefile
index 4f0582cd95a..46c267bbe53 100644
--- a/src/backend/utils/cache/Makefile
+++ b/src/backend/utils/cache/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/cache
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/cache/Makefile,v 1.5 1997/12/20 00:28:29 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/cache/Makefile,v 1.6 1998/04/06 00:26:33 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = catcache.o inval.o rel.o relcache.o syscache.o lsyscache.o fcache.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/error/Makefile b/src/backend/utils/error/Makefile
index b83fa3b40b6..20d7a9bc8b3 100644
--- a/src/backend/utils/error/Makefile
+++ b/src/backend/utils/error/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/error
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/error/Makefile,v 1.4 1997/12/20 00:28:38 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/error/Makefile,v 1.5 1998/04/06 00:26:45 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = assert.o elog.o exc.o excabort.o excid.o format.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/fmgr/Makefile b/src/backend/utils/fmgr/Makefile
index 1b354d11551..cf503d2cb87 100644
--- a/src/backend/utils/fmgr/Makefile
+++ b/src/backend/utils/fmgr/Makefile
@@ -4,24 +4,14 @@
 #    Makefile for utils/fmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/Makefile,v 1.5 1997/12/20 00:28:47 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/fmgr/Makefile,v 1.6 1998/04/06 00:26:52 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
-
-ifeq ($(PORTNAME), linux)
-# LINUX_ELF tells us to use the ELF dynamic load facilities that come with
-# Linux.
-  ifdef LINUX_ELF
-    CFLAGS+=-DLINUX_ELF
-  endif
-endif
+CFLAGS += -I../..
 
 OBJS = dfmgr.o fmgr.o
 
@@ -31,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/hash/Makefile b/src/backend/utils/hash/Makefile
index 75b1de172cb..419e204069f 100644
--- a/src/backend/utils/hash/Makefile
+++ b/src/backend/utils/hash/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/hash
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/hash/Makefile,v 1.4 1997/12/20 00:28:58 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/hash/Makefile,v 1.5 1998/04/06 00:26:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = dynahash.o hashfn.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/init/Makefile b/src/backend/utils/init/Makefile
index e1c7702f1e0..debf0299143 100644
--- a/src/backend/utils/init/Makefile
+++ b/src/backend/utils/init/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/init
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.6 1997/12/20 00:29:06 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.7 1998/04/06 00:27:07 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = enbl.o findbe.o globals.o miscinit.o postinit.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/misc/Makefile b/src/backend/utils/misc/Makefile
index 537d95225d0..a827137ed00 100644
--- a/src/backend/utils/misc/Makefile
+++ b/src/backend/utils/misc/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/misc
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.5 1997/12/20 00:29:12 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.6 1998/04/06 00:27:16 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../..
-
-CFLAGS += $(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = database.o superuser.o 
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/mmgr/Makefile b/src/backend/utils/mmgr/Makefile
index 4ac58d6dad5..3d11b4fd372 100644
--- a/src/backend/utils/mmgr/Makefile
+++ b/src/backend/utils/mmgr/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/mmgr
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Makefile,v 1.4 1997/12/20 00:29:19 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Makefile,v 1.5 1998/04/06 00:27:24 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = aset.o mcxt.o palloc.o portalmem.o oset.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/sort/Makefile b/src/backend/utils/sort/Makefile
index 56dd66b726f..f2fb18dc6ce 100644
--- a/src/backend/utils/sort/Makefile
+++ b/src/backend/utils/sort/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/sort
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/sort/Makefile,v 1.4 1997/12/20 00:29:29 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/sort/Makefile,v 1.5 1998/04/06 00:27:37 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = lselect.o psort.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/time/Makefile b/src/backend/utils/time/Makefile
index c2c6f834a83..a9ac73909f3 100644
--- a/src/backend/utils/time/Makefile
+++ b/src/backend/utils/time/Makefile
@@ -4,16 +4,14 @@
 #    Makefile for utils/time
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/utils/time/Makefile,v 1.4 1997/12/20 00:29:35 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/backend/utils/time/Makefile,v 1.5 1998/04/06 00:27:42 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR = ../../..
 include ../../../Makefile.global
 
-INCLUDE_OPT = -I../.. 
-
-CFLAGS+=$(INCLUDE_OPT)
+CFLAGS += -I../..
 
 OBJS = tqual.o
 
@@ -23,7 +21,7 @@ SUBSYS.o: $(OBJS)
 	$(LD) -r -o 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/bin/Makefile b/src/bin/Makefile
index 7ab3ffcca1e..6ca829e7555 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -7,35 +7,22 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.11 1997/11/07 06:24:33 thomas Exp $
+#    $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.12 1998/04/06 00:27:50 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ..
 include ../Makefile.global
 
-.DEFAULT all:
-#
-# C programs
-#
-	$(MAKE) -C pg_id $@
-	$(MAKE) -C pg_version $@
-	$(MAKE) -C psql $@
-	$(MAKE) -C pg_dump $@
-	$(MAKE) -C pg_passwd $@
-#
-# Shell scripts
-# 
-	$(MAKE) -C cleardbdir $@
-	$(MAKE) -C createdb $@
-	$(MAKE) -C createuser $@
-	$(MAKE) -C destroydb $@
-	$(MAKE) -C destroyuser $@
-	$(MAKE) -C initdb $@
-	$(MAKE) -C initlocation $@
+DIRS = pg_id pg_version psql pg_dump pg_passwd cleardbdir createuser \
+	destroydb initdb initlocation
+
 #
 # TCL/TK programs
 #
 ifeq ($(USE_TCL), true)
-	$(MAKE) -C pgtclsh $@
+	DIRS += pgtclsh
 endif
+
+.DEFAULT all:
+	for i in $(DIRS); do $(MAKE) -C $$i $@; done
diff --git a/src/bin/cleardbdir/Makefile b/src/bin/cleardbdir/Makefile
index 9326f0260a8..1d38b127a0c 100644
--- a/src/bin/cleardbdir/Makefile
+++ b/src/bin/cleardbdir/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.5 1998/04/05 21:59:52 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.6 1998/04/06 00:27:55 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -25,4 +25,4 @@ install: cleardbdir
 clean: 
 	rm -f cleardbdir
 
-dep:
+dep depend:
diff --git a/src/bin/createdb/Makefile b/src/bin/createdb/Makefile
index e79c00f8acc..7e789dd9c49 100644
--- a/src/bin/createdb/Makefile
+++ b/src/bin/createdb/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.5 1998/04/05 21:59:55 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/createdb/Attic/Makefile,v 1.6 1998/04/06 00:28:04 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -25,4 +25,4 @@ install: createdb
 clean:
 	rm -f createdb
 
-dep:
+dep depend:
diff --git a/src/bin/createuser/Makefile b/src/bin/createuser/Makefile
index c2ebf3b2836..d63b0b2ee7f 100644
--- a/src/bin/createuser/Makefile
+++ b/src/bin/createuser/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.5 1998/04/05 21:59:59 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/createuser/Attic/Makefile,v 1.6 1998/04/06 00:28:16 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -29,4 +29,4 @@ install: createuser
 clean:
 	rm -f createuser
 
-dep:
+dep depend:
diff --git a/src/bin/destroydb/Makefile b/src/bin/destroydb/Makefile
index 95b8fa69444..fd59639d092 100644
--- a/src/bin/destroydb/Makefile
+++ b/src/bin/destroydb/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.5 1998/04/05 22:00:08 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/Makefile,v 1.6 1998/04/06 00:28:25 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -25,4 +25,4 @@ install: destroydb
 clean:
 	rm -f destroydb
 
-dep:
+dep depend:
diff --git a/src/bin/destroyuser/Makefile b/src/bin/destroyuser/Makefile
index 1641bc63494..72a9c5572f9 100644
--- a/src/bin/destroyuser/Makefile
+++ b/src/bin/destroyuser/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.5 1998/04/05 22:00:20 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/Makefile,v 1.6 1998/04/06 00:28:37 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -29,4 +29,4 @@ install: destroyuser
 clean:
 	rm -f destroyuser
 
-dep:
+dep depend:
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile
index 06bb4b76402..67cd26bec1c 100644
--- a/src/bin/initdb/Makefile
+++ b/src/bin/initdb/Makefile
@@ -7,26 +7,19 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.5 1998/04/05 22:00:33 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.6 1998/04/06 00:28:46 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR= ../..
 include ../../Makefile.global
 
-SEDSCRIPT= \
-    -e "s^_fUnKy_NAMEDATALEN_sTuFf_^$(NAMEDATALEN)^g" \
-    -e "s^_fUnKy_OIDNAMELEN_sTuFf_^$(OIDNAMELEN)^g" 
-
 all: initdb
 
-initdb: initdb.sh
-	sed $(SEDSCRIPT) <initdb.sh >initdb
-
 install: initdb
 	$(INSTALL) $(INSTL_EXE_OPTS) $< $(BINDIR)/$<
 
 clean:
 	rm -f initdb
 
-dep:
+dep depend:
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 8c1b81f3a90..cf3ddc5f284 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -26,7 +26,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.40 1998/03/22 19:35:30 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.41 1998/04/06 00:28:53 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -36,9 +36,6 @@
 #
 # ----------------
 
-NAMEDATALEN=_fUnKy_NAMEDATALEN_sTuFf_
-OIDNAMELEN=_fUnKy_OIDNAMELEN_sTuFf_
-
 CMDNAME=`basename $0`
 
 # Find the default PGLIB directory (the directory that contains miscellaneous 
@@ -266,8 +263,6 @@ echo "Running: postgres $BACKENDARGS template1"
 
 cat $TEMPLATE \
 | sed -e "s/postgres PGUID/$POSTGRES_SUPERUSERNAME $POSTGRES_SUPERUID/" \
-      -e "s/NAMEDATALEN/$NAMEDATALEN/g" \
-      -e "s/OIDNAMELEN/$OIDNAMELEN/g" \
       -e "s/PGUID/$POSTGRES_SUPERUID/" \
 | postgres $BACKENDARGS template1
 
@@ -296,8 +291,6 @@ if [ $template_only -eq 0 ]; then
 
     cat $GLOBAL \
     | sed -e "s/postgres PGUID/$POSTGRES_SUPERUSERNAME $POSTGRES_SUPERUID/" \
-        -e "s/NAMEDATALEN/$NAMEDATALEN/g" \
-        -e "s/OIDNAMELEN/$OIDNAMELEN/g" \
         -e "s/PGUID/$POSTGRES_SUPERUID/" \
     | postgres $BACKENDARGS template1
 
diff --git a/src/bin/initlocation/Makefile b/src/bin/initlocation/Makefile
index 21d26ab2b9b..905a402c1a6 100644
--- a/src/bin/initlocation/Makefile
+++ b/src/bin/initlocation/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.2 1998/04/05 22:00:40 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.3 1998/04/06 00:29:00 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -29,4 +29,4 @@ install: initlocation
 clean:
 	rm -f initlocation
 
-dep:
+dep depend:
diff --git a/src/bin/ipcclean/Makefile b/src/bin/ipcclean/Makefile
index 520244640fb..0286c0c1f32 100644
--- a/src/bin/ipcclean/Makefile
+++ b/src/bin/ipcclean/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.4 1998/04/05 22:00:48 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.5 1998/04/06 00:29:03 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -28,4 +28,4 @@ install: ipcclean
 clean:
 	rm -f ipcclean
 
-dep:
+dep depend:
diff --git a/src/bin/pg_dump/Makefile.in b/src/bin/pg_dump/Makefile.in
index fa170a3208b..7543d338b75 100644
--- a/src/bin/pg_dump/Makefile.in
+++ b/src/bin/pg_dump/Makefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.6 1998/04/05 22:00:58 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/Makefile.in,v 1.7 1998/04/06 00:29:08 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -43,7 +43,7 @@ install: pg_dump
 	$(INSTALL) $(INSTL_EXE_OPTS) pg_dumpall $(BINDIR)/pg_dumpall
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f pg_dump $(OBJS) 
diff --git a/src/bin/pg_id/Makefile b/src/bin/pg_id/Makefile
index 41766e547bb..075ced9a36a 100644
--- a/src/bin/pg_id/Makefile
+++ b/src/bin/pg_id/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.8 1998/04/05 22:01:10 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.9 1998/04/06 00:29:14 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -36,7 +36,7 @@ install: pg_id
 	$(INSTALL) $(INSTL_EXE_OPTS) pg_id $(BINDIR)/pg_id
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f pg_id $(OBJS) 
diff --git a/src/bin/pg_passwd/Makefile b/src/bin/pg_passwd/Makefile
index 439c1945c26..408640fea52 100644
--- a/src/bin/pg_passwd/Makefile
+++ b/src/bin/pg_passwd/Makefile
@@ -22,7 +22,7 @@ submake:
 	$(MAKE) -C $(LIBPQDIR) libpq.a
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean:
 	rm -f pg_passwd $(OBJS)
diff --git a/src/bin/pg_version/Makefile.in b/src/bin/pg_version/Makefile.in
index 470d33f1727..8a10428ee3f 100644
--- a/src/bin/pg_version/Makefile.in
+++ b/src/bin/pg_version/Makefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile.in,v 1.2 1998/04/05 22:01:30 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile.in,v 1.3 1998/04/06 00:29:36 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -31,7 +31,7 @@ install: pg_version
 	$(INSTALL) $(INSTL_EXE_OPTS) pg_version $(BINDIR)/pg_version
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f pg_version pg_version.o
diff --git a/src/bin/pgtclsh/Makefile b/src/bin/pgtclsh/Makefile
index a386802bb4f..1df38a830d3 100644
--- a/src/bin/pgtclsh/Makefile
+++ b/src/bin/pgtclsh/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.14 1998/04/05 22:01:35 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.15 1998/04/06 00:29:46 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -42,3 +42,6 @@ install: pgtclsh pgtksh
 
 clean:
 	rm -f pgtclAppInit.o pgtkAppInit.o pgtclsh pgtksh
+
+dep depend:
+	$(CC) -MM $(CFLAGS) *.c > depend
diff --git a/src/bin/psql/Makefile.in b/src/bin/psql/Makefile.in
index 9722413c05e..3a27c45a2ca 100644
--- a/src/bin/psql/Makefile.in
+++ b/src/bin/psql/Makefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.8 1998/04/05 22:01:41 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.9 1998/04/06 00:29:56 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -42,7 +42,7 @@ install: psql
 	$(INSTALL) $(INSTL_EXE_OPTS) psql $(BINDIR)/psql
 
 depend dep:
-	$(CC) -MM $(INCLUDE_OPT) *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 clean: 
 	rm -f psql $(OBJS) 
diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile
index f4768822a65..029b3baa62a 100644
--- a/src/interfaces/ecpg/Makefile
+++ b/src/interfaces/ecpg/Makefile
@@ -1,4 +1,4 @@
-all install uninstall clean:
+all install uninstall clean dep depend:
 	$(MAKE) -C include $@
 	$(MAKE) -C lib $@
 	$(MAKE) -C preproc $@
diff --git a/src/interfaces/ecpg/include/Makefile b/src/interfaces/ecpg/include/Makefile
index 739023a43e4..bfb6840b68c 100644
--- a/src/interfaces/ecpg/include/Makefile
+++ b/src/interfaces/ecpg/include/Makefile
@@ -14,3 +14,5 @@ uninstall::
 	rm -f $(HEADERDIR)/ecpglib.h
 	rm -f $(HEADERDIR)/ecpgtype.h
 	rm -f $(HEADERDIR)/sqlca.h
+
+dep depend:
diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in
index b2da50ebe34..31a81f088de 100644
--- a/src/interfaces/ecpg/lib/Makefile.in
+++ b/src/interfaces/ecpg/lib/Makefile.in
@@ -53,6 +53,8 @@ $(shlib): ecpglib.o typename.o
 clean:
 	rm -f *.o *.a core a.out *~ $(shlib) libecpg.so
 
+dep depend:
+
 install: libecpg.a $(shlib) $(install-shlib-dep)
 	$(INSTALL) $(INSTLOPTS) libecpg.a $(LIBDIR)
 
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index 26a953edecf..af684bd3d57 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -20,6 +20,9 @@ install: all
 uninstall:
 	rm -f $(BINDIR)/ecpg
 
+dep depend:
+	$(CC) -MM $(CFLAGS) *.c > depend
+
 # Rule that really do something.
 ecpg: y.tab.o pgc.o type.o ecpg.o ../lib/typename.o
 	$(CC) -o ecpg y.tab.o pgc.o type.o ecpg.o ../lib/typename.o $(LEXLIB)
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index c72518540bd..164d4978c83 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -12,3 +12,5 @@ perftest.c: perftest.pgc
 
 clean:
 	/bin/rm test2 test2.c perftest perftest.c log
+
+dep depend:
diff --git a/src/interfaces/jdbc/Makefile b/src/interfaces/jdbc/Makefile
index d7ad13ff08c..4ebb6c2c48b 100644
--- a/src/interfaces/jdbc/Makefile
+++ b/src/interfaces/jdbc/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for Java JDBC interface
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.6 1998/02/09 03:22:30 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.7 1998/04/06 00:30:36 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -44,6 +44,8 @@ all:	  postgresql.jar
 	@echo ------------------------------------------------------------
 	@echo
 
+dep depend:
+
 # This rule builds the javadoc documentation
 doc:
 	export CLASSPATH=.;\
diff --git a/src/interfaces/libpgtcl/Makefile.in b/src/interfaces/libpgtcl/Makefile.in
index a5add6f9bfe..e8bff5a1315 100644
--- a/src/interfaces/libpgtcl/Makefile.in
+++ b/src/interfaces/libpgtcl/Makefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.7 1998/04/05 22:02:29 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.8 1998/04/06 00:30:46 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -104,3 +104,5 @@ install-shlib: $(shlib)
 .PHONY: clean
 clean: 
 	rm -f $(OBJS) $(shlib) libpgtcl.a libpgtcl.so
+
+dep depend:
diff --git a/src/interfaces/libpq++/Makefile b/src/interfaces/libpq++/Makefile
index f83932630c0..a56f2b6249c 100644
--- a/src/interfaces/libpq++/Makefile
+++ b/src/interfaces/libpq++/Makefile
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.11 1998/04/05 22:02:41 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.12 1998/04/06 00:31:13 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -117,9 +117,9 @@ clean:
 	rm $(LIBNAME).a $(OBJS)
 	$(MAKE) -C examples clean
 
+dep depend:
+	$(CXX) -MM $(CXXFLAGS) *.cc > depend
 
-###########################################################################
-# Dependencies for the library
-###########################################################################
-include ./dependencies
-
+ifeq (depend,$(wildcard depend))
+include depend
+endif
diff --git a/src/interfaces/libpq/Makefile.in b/src/interfaces/libpq/Makefile.in
index aedcf95cf29..ad966e89444 100644
--- a/src/interfaces/libpq/Makefile.in
+++ b/src/interfaces/libpq/Makefile.in
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.10 1998/04/05 22:02:33 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.11 1998/04/06 00:30:58 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -178,7 +178,7 @@ install-shlib: $(shlib)
 	ln -s $(shlib) $(LIBDIR)/libpq.so
 
 depend dep:
-	$(CC) -MM *.c >depend
+	$(CC) -MM $(CFLAGS) *.c >depend
 
 .PHONY: clean
 clean:
diff --git a/src/lextest/Makefile b/src/lextest/Makefile
index 5ce9d24a68a..d1cdc1a3bac 100644
--- a/src/lextest/Makefile
+++ b/src/lextest/Makefile
@@ -20,3 +20,5 @@ lextest: lextest.c scan.l
 
 clean:
 	rm -f lextest lex.yy.c lex.yy.o lextest.o
+
+dep:
diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux
index 459ad1550c7..5a1293ac4c9 100644
--- a/src/makefiles/Makefile.linux
+++ b/src/makefiles/Makefile.linux
@@ -1,11 +1,5 @@
-ifdef LINUX_ELF
-# test for __ELF__ in C code so do not need LINUX_ELF defined
-# - thomas 1997-12-29
-#CFLAGS+= -DLINUX_ELF
 LDFLAGS+= -export-dynamic -Wl,-rpath -Wl,$(LIBDIR)
-endif
 MK_NO_LORDER= true
 
 %.so: %.o
 	$(CC) -shared -o $@ $<
-
diff --git a/src/man/Makefile b/src/man/Makefile
index bd036bdb614..d5be452208b 100644
--- a/src/man/Makefile
+++ b/src/man/Makefile
@@ -8,28 +8,26 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/man/Attic/Makefile,v 1.3 1996/11/20 22:53:49 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/man/Attic/Makefile,v 1.4 1998/04/06 00:31:52 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
 SRCDIR=..
 include ../Makefile.global
 
-install-man:
+install:
 	-mkdir -p $(POSTMANDIR)
-	-mkdir $(POSTMANDIR)/man1
-	-mkdir $(POSTMANDIR)/man3
-	-mkdir $(POSTMANDIR)/man5
-	-mkdir $(POSTMANDIR)/manl
+	-mkdir -p $(POSTMANDIR)/man1
+	-mkdir -p $(POSTMANDIR)/man3
+	-mkdir -p $(POSTMANDIR)/man5
+	-mkdir -p $(POSTMANDIR)/manl
 	cp *.1* $(POSTMANDIR)/man1
 	cp *.3* $(POSTMANDIR)/man3
 	cp *.5* $(POSTMANDIR)/man5
 	cp *.l* $(POSTMANDIR)/manl
 
-install:: install-man
-
 clean:
-	# do nothing
 
 all:
-	# do nothing
+
+dep depend:
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile
index c02757aa3bb..c5d9376a61e 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.2 1998/04/05 22:02:56 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.3 1998/04/06 00:31:59 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -89,3 +89,4 @@ clean:
 install: all
 	$(INSTALL) $(INSTL_LIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS)
 
+dep depend:
diff --git a/src/template/linux-elf b/src/template/linux-elf
index 0747feaa594..7f120ea418e 100644
--- a/src/template/linux-elf
+++ b/src/template/linux-elf
@@ -1,8 +1,8 @@
 AROPT:crs
-CFLAGS:-O2 
+CFLAGS:-O2 -g
 SHARED_LIB:-fpic
 ALL:
-SRCH_INC:/usr/include/ncurses /usr/include/readline
+SRCH_INC:
 SRCH_LIB:
 USE_LOCALE:no
 DLSUFFIX:.so
diff --git a/src/template/linux-elf-sparc b/src/template/linux-elf-sparc
index a2b4213fa72..65415dd3a54 100644
--- a/src/template/linux-elf-sparc
+++ b/src/template/linux-elf-sparc
@@ -2,7 +2,7 @@ AROPT:crs
 CFLAGS:-O2
 SHARED_LIB:-fpic
 ALL:
-SRCH_INC:/usr/include/ncurses /usr/include/readline
+SRCH_INC:
 SRCH_LIB:
 USE_LOCALE:no
 DLSUFFIX:.so
diff --git a/src/template/linuxalpha b/src/template/linuxalpha
index 0747feaa594..4804ea1cd82 100644
--- a/src/template/linuxalpha
+++ b/src/template/linuxalpha
@@ -2,7 +2,7 @@ AROPT:crs
 CFLAGS:-O2 
 SHARED_LIB:-fpic
 ALL:
-SRCH_INC:/usr/include/ncurses /usr/include/readline
+SRCH_INC:
 SRCH_LIB:
 USE_LOCALE:no
 DLSUFFIX:.so
diff --git a/src/utils/Makefile b/src/utils/Makefile
index c695b569884..cf38bc6eeb7 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for utils
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/utils/Attic/Makefile,v 1.4 1998/02/27 02:41:21 scrappy Exp $
+#    $Header: /cvsroot/pgsql/src/utils/Attic/Makefile,v 1.5 1998/04/06 00:32:26 momjian Exp $
 #
 # About strdup:  Some systems have strdup in their standard library, others
 # don't.  Ones that don't will use this make file to compile the strdup.c
@@ -23,7 +23,7 @@ all: version.o
 install:
 
 depend dep:
-	$(CC) -MM *.c >depend
+	$(CC) $(CFLAGS) -MM *.c >depend
 
 clean: 
 	rm -f version.o
-- 
GitLab