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.
This commit is contained in:
Peter Eisentraut 2000-09-08 18:29:28 +00:00
parent f2bfe8a24c
commit da06bc1d40
10 changed files with 40 additions and 33 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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