summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-11-30 20:36:13 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-11-30 20:36:13 +0000
commite5ba2fc5b59ee5a7993b3ab65a32860661da81b8 (patch)
tree7ea763b2dc21ff00fae9edc654890d5e1159cbad /src/bin
parent309112267f0f73ee79e36a3efe1060b34b5c7b46 (diff)
downloadpostgresql-e5ba2fc5b59ee5a7993b3ab65a32860661da81b8.tar.gz
Make all commands that link a program look like
$(CC) $(CFLAGS) $(LDFLAGS) <object files> <extra-libraries> $(LIBS) -o $@ This form seemed to be the most portable, readable, and logical, but in any case it's better than having a dozen different ones in the tree.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_dump/Makefile6
-rw-r--r--src/bin/pg_encoding/Makefile8
-rw-r--r--src/bin/pg_id/Makefile8
-rw-r--r--src/bin/pg_passwd/Makefile5
-rw-r--r--src/bin/pgtclsh/Makefile6
-rw-r--r--src/bin/psql/Makefile8
6 files changed, 22 insertions, 19 deletions
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index ba9a08900b..38a2cf2946 100644
--- a/src/bin/pg_dump/Makefile
+++ b/src/bin/pg_dump/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.26 2000/10/20 21:03:56 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.27 2000/11/30 20:36:11 petere Exp $
#
#-------------------------------------------------------------------------
@@ -20,10 +20,10 @@ override CPPFLAGS+= -I$(libpq_srcdir)
all: submake pg_dump pg_restore pg_dumpall
pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(libpq) $(LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) pg_dump.o common.o $(OBJS) $(libpq) $(LIBS) -o $@
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(libpq) $(LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) pg_restore.o $(OBJS) $(libpq) $(LIBS) -o $@
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
diff --git a/src/bin/pg_encoding/Makefile b/src/bin/pg_encoding/Makefile
index e4c4e4c65c..784d78d4bc 100644
--- a/src/bin/pg_encoding/Makefile
+++ b/src/bin/pg_encoding/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1998, PostgreSQL Global Development Group
#
-# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.11 2000/09/17 13:02:37 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.12 2000/11/30 20:36:11 petere Exp $
#
#-------------------------------------------------------------------------
@@ -14,10 +14,10 @@ include $(top_builddir)/src/Makefile.global
OBJS= pg_encoding.o
-all: submake pg_encoding$(X)
+all: submake pg_encoding
-pg_encoding$(X): $(OBJS)
- $(CC) -o $@ $(OBJS) $(libpq) $(LDFLAGS) $(CFLAGS)
+pg_encoding: $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpq) $(LIBS) -o $@
.PHONY: submake
diff --git a/src/bin/pg_id/Makefile b/src/bin/pg_id/Makefile
index ed9ec2ce06..e9577b4f67 100644
--- a/src/bin/pg_id/Makefile
+++ b/src/bin/pg_id/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (C) 2000 by PostgreSQL Global Development Team
#
-# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.19 2000/09/17 13:02:39 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.20 2000/11/30 20:36:11 petere Exp $
#
#-------------------------------------------------------------------------
@@ -12,10 +12,10 @@ subdir = src/bin/pg_id
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-all: pg_id$(X)
+all: pg_id
-pg_id$(X): pg_id.o
- $(CC) -o $@ $^ $(LDFLAGS)
+pg_id: pg_id.o
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
install: all installdirs
$(INSTALL_PROGRAM) pg_id$(X) $(DESTDIR)$(bindir)/pg_id$(X)
diff --git a/src/bin/pg_passwd/Makefile b/src/bin/pg_passwd/Makefile
index d96b102dfa..e14690c060 100644
--- a/src/bin/pg_passwd/Makefile
+++ b/src/bin/pg_passwd/Makefile
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.12 2000/11/18 19:00:23 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_passwd/Attic/Makefile,v 1.13 2000/11/30 20:36:12 petere Exp $
subdir = src/bin/pg_passwd
top_builddir = ../../..
@@ -6,6 +6,9 @@ include $(top_builddir)/src/Makefile.global
all: pg_passwd
+pg_passwd: pg_passwd.o
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
+
install: all installdirs
$(INSTALL_PROGRAM) pg_passwd$(X) $(DESTDIR)$(bindir)/pg_passwd$(X)
diff --git a/src/bin/pgtclsh/Makefile b/src/bin/pgtclsh/Makefile
index 02b19c8b26..7891eab4f2 100644
--- a/src/bin/pgtclsh/Makefile
+++ b/src/bin/pgtclsh/Makefile
@@ -5,7 +5,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.34 2000/10/20 21:04:00 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pgtclsh/Attic/Makefile,v 1.35 2000/11/30 20:36:12 petere Exp $
#
#-------------------------------------------------------------------------
@@ -39,10 +39,10 @@ endif
all: submake $(PROGRAMS)
pgtclsh: pgtclAppInit.o
- $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LIBS) -o $@
pgtksh: pgtkAppInit.o
- $(CC) $(CFLAGS) -o $@ $< $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LDFLAGS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(libpgtcl) $(libpq) $(TK_LIB_SPEC) $(TK_LIBS) $(TCL_LIB_SPEC) $(LIBS) -o $@
.PHONY: submake
submake:
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index bd38be47b4..3b54c44da8 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.26 2000/10/20 21:04:01 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.27 2000/11/30 20:36:12 petere Exp $
#
#-------------------------------------------------------------------------
@@ -20,7 +20,7 @@ OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \
copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \
tab-complete.o
-all: submake psql$(X)
+all: submake psql
ifdef STRDUP
OBJS+=$(top_builddir)/src/utils/strdup.o
@@ -47,8 +47,8 @@ endif
# End of hacks for picking up backend 'port' modules
-psql$(X): $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(libpq) $(LDFLAGS)
+psql: $(OBJS) $(libpq_builddir)/libpq.a
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(libpq) $(LIBS) -o $@
help.o: $(srcdir)/sql_help.h