summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-09-08 18:29:28 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-09-08 18:29:28 +0000
commitda06bc1d4088508781a82737365a486c2927a2f8 (patch)
tree11190416a85c3b872407293afdc1d948233b69db /src
parentf2bfe8a24c46133f81e188653a127f939eb33c4a (diff)
Make building scripts kind of consistent in look and feel, kind of immune
to parallel make, kind of resistent to corruption due to incomplete builds.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in9
-rw-r--r--src/bin/initdb/Makefile8
-rw-r--r--src/bin/initlocation/Makefile3
-rw-r--r--src/bin/ipcclean/Makefile3
-rw-r--r--src/bin/pg-config/Makefile8
-rw-r--r--src/bin/pg_ctl/Makefile3
-rw-r--r--src/bin/pg_dump/Makefile11
-rw-r--r--src/bin/pg_dump/pg_dumpall.sh8
-rw-r--r--src/bin/scripts/Makefile9
-rw-r--r--src/bin/scripts/createlang.sh11
10 files changed, 40 insertions, 33 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 949d240fb2c..d0188db79f7 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.92 2000/08/31 16:09:22 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.93 2000/09/08 18:29:20 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -12,6 +12,11 @@
# parent directory of the directory this file is in.)
#------------------------------------------------------------------------------
+# Delete target files if the command fails after it has
+# started to update the file.
+.DELETE_ON_ERROR:
+
+
# PostgreSQL version number
VERSION = @VERSION@
@@ -294,7 +299,7 @@ COMPILE.c = $(CC) -c $(CPPFLAGS) $(CFLAGS)
autodepend = @autodepend@
-ifdef autodepend
+ifeq ($(autodepend), yes)
DEPDIR = .deps
df = $(DEPDIR)/$(*F)
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile
index f8f656f81c2..d856f8b4dbd 100644
--- a/src/bin/initdb/Makefile
+++ b/src/bin/initdb/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.22 2000/09/01 13:15:27 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.23 2000/09/08 18:29:21 petere Exp $
#
#-------------------------------------------------------------------------
@@ -15,14 +15,12 @@ include $(top_builddir)/src/Makefile.global
all: initdb
initdb: initdb.sh $(top_builddir)/src/Makefile.global
- rm -f $@ $@.tmp
sed -e 's/@MULTIBYTE@/$(MULTIBYTE)/g' \
-e 's/@VERSION@/$(VERSION)/g' \
-e 's,@bindir@,$(bindir),g' \
-e 's,@datadir@,$(datadir),g' \
- $< >$@.tmp
- chmod a+x $@.tmp
- mv $@.tmp $@
+ $< >$@
+ chmod a+x $@
install: all installdirs
$(INSTALL_SCRIPT) initdb $(bindir)/initdb
diff --git a/src/bin/initlocation/Makefile b/src/bin/initlocation/Makefile
index 05b32819dec..2ea19e0462e 100644
--- a/src/bin/initlocation/Makefile
+++ b/src/bin/initlocation/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.10 2000/08/31 16:11:07 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.11 2000/09/08 18:29:22 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,6 +16,7 @@ all: initlocation
initlocation: initlocation.sh
cp $< $@
+ chmod a+x $@
install: all installdirs
$(INSTALL_SCRIPT) initlocation $(bindir)/initlocation
diff --git a/src/bin/ipcclean/Makefile b/src/bin/ipcclean/Makefile
index ab452f9e894..43d640afead 100644
--- a/src/bin/ipcclean/Makefile
+++ b/src/bin/ipcclean/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.12 2000/08/31 16:11:08 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/Makefile,v 1.13 2000/09/08 18:29:23 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,6 +16,7 @@ all: ipcclean
ipcclean: ipcclean.sh
cp $< $@
+ chmod a+x $@
install: all installdirs
$(INSTALL_SCRIPT) ipcclean $(bindir)/ipcclean
diff --git a/src/bin/pg-config/Makefile b/src/bin/pg-config/Makefile
index 3c2b5a0866d..241d722c169 100644
--- a/src/bin/pg-config/Makefile
+++ b/src/bin/pg-config/Makefile
@@ -1,4 +1,4 @@
-# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.1 2000/08/26 13:08:16 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg-config/Attic/Makefile,v 1.2 2000/09/08 18:29:26 petere Exp $
subdir = src/bin/pg-config
top_builddir = ../../..
@@ -7,16 +7,14 @@ include $(top_builddir)/src/Makefile.global
all: pg-config
pg-config: pg-config.sh $(top_builddir)/config.status $(top_builddir)/src/Makefile.global Makefile
- rm -f $@ $@.tmp
configure=`sed -n '7s,^# [^ ]*configure *,,p' $(top_builddir)/config.status` && \
sed -e 's,@bindir@,$(bindir),g' \
-e 's,@includedir@,$(includedir),g' \
-e 's,@libdir@,$(libdir),g' \
-e "s,@configure@,$$configure,g" \
-e 's,@version@,$(VERSION),g' \
- $< >$@.tmp
- chmod a+x $@.tmp
- mv $@.tmp $@
+ $< >$@
+ chmod a+x $@
install: all installdirs
$(INSTALL_SCRIPT) pg-config $(bindir)/pg-config
diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile
index 200fdf8d6a6..dc7defbd218 100644
--- a/src/bin/pg_ctl/Makefile
+++ b/src/bin/pg_ctl/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1999, PostgreSQL Global Development Group
#
-# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.7 2000/08/31 16:11:10 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Makefile,v 1.8 2000/09/08 18:29:27 petere Exp $
#
#-------------------------------------------------------------------------
@@ -16,6 +16,7 @@ all: pg_ctl
pg_ctl: pg_ctl.sh
cp $< $@
+ chmod a+x $@
install: all installdirs
$(INSTALL_SCRIPT) pg_ctl $(bindir)/pg_ctl
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index 87d9ace079d..53d0e8e9302 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.23 2000/08/31 16:11:13 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.24 2000/09/08 18:29:27 petere Exp $
#
#-------------------------------------------------------------------------
@@ -30,10 +30,11 @@ pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
$(MAKE) -C ../../utils strdup.o
pg_dumpall: pg_dumpall.sh
- sed -e 's:__VERSION__:$(VERSION):g' \
- -e 's:__MULTIBYTE__:$(MULTIBYTE):g' \
- -e 's:__bindir__:$(bindir):g' \
- < $< > $@
+ sed -e 's,@VERSION@,$(VERSION),g' \
+ -e 's,@MULTIBYTE@,$(MULTIBYTE),g' \
+ -e 's,@bindir@,$(bindir),g' \
+ $< >$@
+ chmod a+x $@
.PHONY: submake
submake:
diff --git a/src/bin/pg_dump/pg_dumpall.sh b/src/bin/pg_dump/pg_dumpall.sh
index 3c0d28397b2..e6386815623 100644
--- a/src/bin/pg_dump/pg_dumpall.sh
+++ b/src/bin/pg_dump/pg_dumpall.sh
@@ -6,14 +6,14 @@
# and "pg_group" tables, which belong to the whole installation rather
# than any one individual database.
#
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.3 2000/07/04 16:29:59 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.4 2000/09/08 18:29:27 petere Exp $
CMDNAME=`basename $0`
# substituted at build
-VERSION='__VERSION__'
-MULTIBYTE='__MULTIBYTE__'
-bindir='__bindir__'
+VERSION='@VERSION@'
+MULTIBYTE='@MULTIBYTE@'
+bindir='@bindir@'
#
# Find out where we're located
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile
index e43fc901218..85ef8990487 100644
--- a/src/bin/scripts/Makefile
+++ b/src/bin/scripts/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.8 2000/08/31 16:11:25 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Makefile,v 1.9 2000/09/08 18:29:28 petere Exp $
#
#-------------------------------------------------------------------------
@@ -17,9 +17,10 @@ SCRIPTS := createdb dropdb createuser dropuser createlang droplang vacuumdb
all: $(SCRIPTS)
createlang: createlang.sh
- sed -e 's:__DLSUFFIX__:$(DLSUFFIX):g' \
- -e 's:__libdir__:$(libdir):g' \
- $< > $@
+ sed -e 's/@DLSUFFIX@/$(DLSUFFIX)/g' \
+ -e 's,@libdir@,$(libdir),g' \
+ $< >$@
+ chmod a+x $@
install: all installdirs
for i in $(SCRIPTS); do $(INSTALL_SCRIPT) $$i $(bindir) || exit; done
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index 46e503baf49..0ba0edaa97b 100644
--- a/src/bin/scripts/createlang.sh
+++ b/src/bin/scripts/createlang.sh
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.14 2000/08/20 11:56:29 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.15 2000/09/08 18:29:28 petere Exp $
#
#-------------------------------------------------------------------------
@@ -160,7 +160,7 @@ fi
# Check that we have PGLIB
# ----------
if [ -z "$PGLIB" ]; then
- PGLIB='__libdir__'
+ PGLIB='@libdir@'
fi
# ----------
@@ -206,13 +206,14 @@ case "$langname" in
;;
esac
+DLSUFFIX='@DLSUFFIX@'
# ----------
# Check that the shared object for the call handler is installed
# in PGLIB
# ----------
-if [ ! -f $PGLIB/${object}__DLSUFFIX__ ]; then
- echo "$CMDNAME: cannot find the file $PGLIB/${langname}__DLSUFFIX__"
+if [ ! -f "$PGLIB/$object$DLSUFFIX" ]; then
+ echo "$CMDNAME: cannot find the file \`$PGLIB/$langname$DLSUFFIX'"
echo ""
echo "This file contains the call handler for $lancomp. By default,"
echo "only PL/pgSQL is built and installed; other languages must be"
@@ -251,7 +252,7 @@ fi
# ----------
# Create the call handler and the language
# ----------
-$PSQL "CREATE FUNCTION $handler () RETURNS OPAQUE AS '$PGLIB/${object}__DLSUFFIX__' LANGUAGE 'newC'"
+$PSQL "CREATE FUNCTION $handler () RETURNS OPAQUE AS '$PGLIB/${object}$DLSUFFIX' LANGUAGE 'newC'"
if [ $? -ne 0 ]; then
echo "$CMDNAME: language installation failed"
exit 1