From d9466046c076b023b55d448d3cce6980dac24865 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 4 Dec 2000 01:32:19 +0000
Subject: [PATCH] Fix bogus makefiles ... these didn't build on platforms that
 are sticky about being given accurate references to referenced libraries ...

---
 contrib/findoidjoins/Makefile | 17 ++++++++++++++---
 contrib/pg_dumplo/Makefile    |  7 ++++---
 contrib/pgbench/Makefile      | 17 ++++++++++++++---
 contrib/vacuumlo/Makefile     | 10 +++++++---
 4 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/contrib/findoidjoins/Makefile b/contrib/findoidjoins/Makefile
index 16bbc3e5272..ab1750e71bf 100644
--- a/contrib/findoidjoins/Makefile
+++ b/contrib/findoidjoins/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/Makefile,v 1.10 2000/10/20 21:03:06 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/Makefile,v 1.11 2000/12/04 01:32:18 tgl Exp $
 #
 
 subdir = contrib/findoidjoins
@@ -7,10 +7,14 @@ top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
 override CPPFLAGS += -I$(libpgeasy_srcdir) -I$(libpq_srcdir)
-override LIBS += $(libpgeasy)
+
+OBJS	= findoidjoins.o
 
 all: findoidjoins
 
+findoidjoins: $(OBJS) $(libpgeasy_builddir)/libpgeasy.a $(libpq_builddir)/libpq.a
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpgeasy) $(libpq) $(LIBS) -o $@
+
 install: all installdirs
 	$(INSTALL_PROGRAM) findoidjoins$(X)	$(bindir)
 	$(INSTALL_SCRIPT) make_oidjoins_check	$(bindir)
@@ -23,4 +27,11 @@ uninstall:
 	rm -f $(bindir)/findoidjoins$(X) $(bindir)/make_oidjoins_check $(docdir)/contrib/README.findoidjoins
 
 clean distclean maintainer-clean:
-	rm -f findoidjoins$(X)
+	rm -f findoidjoins$(X) $(OBJS)
+
+depend dep:
+	$(CC) -MM -MG $(CFLAGS) *.c > depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif
diff --git a/contrib/pg_dumplo/Makefile b/contrib/pg_dumplo/Makefile
index 2342ea20be5..a3156945c3b 100644
--- a/contrib/pg_dumplo/Makefile
+++ b/contrib/pg_dumplo/Makefile
@@ -1,14 +1,15 @@
 #
-# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.8 2000/11/30 20:36:09 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/Makefile,v 1.9 2000/12/04 01:32:18 tgl Exp $
 #
 
 subdir = contrib/pg_dumplo
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
-OBJS	= main.o lo_export.o lo_import.o utils.o
 override CPPFLAGS += -I$(libpq_srcdir)
 
+OBJS	= main.o lo_export.o lo_import.o utils.o
+
 all: pg_dumplo
 
 pg_dumplo: $(OBJS) $(libpq_builddir)/libpq.a
@@ -25,7 +26,7 @@ uninstall:
 	rm -f $(bindir)/pg_dumplo$(X) $(docdir)/contrib/README.pg_dumplo
 
 clean distclean maintainer-clean:
-	rm -f pg_dumplo $(OBJS)
+	rm -f pg_dumplo$(X) $(OBJS)
 
 depend dep:
 	$(CC) -MM -MG $(CFLAGS) *.c > depend
diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile
index bedb1d0de35..61f71e58f17 100644
--- a/contrib/pgbench/Makefile
+++ b/contrib/pgbench/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/pgbench/Makefile,v 1.7 2000/10/20 21:03:26 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/pgbench/Makefile,v 1.8 2000/12/04 01:32:19 tgl Exp $
 #
 
 subdir = contrib/pgbench
@@ -7,10 +7,14 @@ top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
 override CPPFLAGS += -I$(libpq_srcdir)
-override LIBS += $(libpq)
+
+OBJS	= pgbench.o
 
 all: pgbench
 
+pgbench: $(OBJS) $(libpq_builddir)/libpq.a
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@
+
 install: all installdirs
 	$(INSTALL_PROGRAM) pgbench$(X)	$(bindir)
 	$(INSTALL_DATA) README.pgbench	$(docdir)/contrib
@@ -23,4 +27,11 @@ uninstall:
 	rm -f $(bindir)/pgbench$(X) $(docdir)/contrib/README.pgbench $(docdir)/contrib/README.pgbench_jis
 
 clean distclean maintainer-clean:
-	rm -f pgbench$(X)
+	rm -f pgbench$(X) $(OBJS)
+
+depend dep:
+	$(CC) -MM -MG $(CFLAGS) *.c > depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif
diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile
index b06568c0a1d..a61733ee586 100644
--- a/contrib/vacuumlo/Makefile
+++ b/contrib/vacuumlo/Makefile
@@ -1,5 +1,5 @@
 #
-# $Header: /cvsroot/pgsql/contrib/vacuumlo/Makefile,v 1.8 2000/10/20 21:03:36 petere Exp $
+# $Header: /cvsroot/pgsql/contrib/vacuumlo/Makefile,v 1.9 2000/12/04 01:32:19 tgl Exp $
 #
 
 subdir = contrib/vacuumlo
@@ -7,10 +7,14 @@ top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
 override CPPFLAGS += -I$(libpq_srcdir)
-override LIBS += $(libpq)
+
+OBJS	= vacuumlo.o
 
 all: vacuumlo
 
+vacuumlo: $(OBJS) $(libpq_builddir)/libpq.a
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@
+
 install: all installdirs
 	$(INSTALL_PROGRAM) vacuumlo$(X) $(bindir)
 	$(INSTALL_DATA) README.vacuumlo $(docdir)/contrib
@@ -22,7 +26,7 @@ uninstall:
 	rm -f $(bindir)/vacuumlo$(X) $(docdir)/contrib/README.vacuumlo
 
 clean distclean maintainer-clean:
-	rm -f vacuumlo$(X)
+	rm -f vacuumlo$(X) $(OBJS)
 
 depend dep:
 	$(CC) -MM -MG $(CFLAGS) *.c > depend
-- 
GitLab