summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2008-03-18 16:24:50 +0000
committerPeter Eisentraut2008-03-18 16:24:50 +0000
commitb7f381e7ae5f6c307ddd2b2c089182bb803cec67 (patch)
treeca0b8f4dfa61efdab8ec93f1ab60538f907225fc
parentca7c724ca8ceda8022184e4517fdf769f559eb49 (diff)
Catch all errors in for and while loops in makefiles. Don't ignore any
errors in any commands, including in various clean targets that have so far been handled inconsistently. make -i is available to ignore all errors in a consistent and official way.
-rw-r--r--GNUmakefile.in18
-rw-r--r--doc/Makefile4
-rw-r--r--src/Makefile24
-rw-r--r--src/backend/snowball/Makefile9
-rw-r--r--src/backend/utils/mb/conversion_procs/Makefile8
-rw-r--r--src/bin/Makefile5
-rw-r--r--src/interfaces/Makefile10
-rw-r--r--src/interfaces/ecpg/Makefile12
-rw-r--r--src/pl/Makefile7
-rw-r--r--src/pl/plpgsql/Makefile5
-rw-r--r--src/test/bench/Makefile6
-rw-r--r--src/test/locale/Makefile2
-rw-r--r--src/test/locale/de_DE.ISO8859-1/Makefile7
-rw-r--r--src/test/locale/gr_GR.ISO8859-7/Makefile7
-rw-r--r--src/test/locale/koi8-r/Makefile7
-rw-r--r--src/test/locale/koi8-to-win1251/Makefile7
-rw-r--r--src/test/regress/GNUmakefile2
17 files changed, 54 insertions, 86 deletions
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 434d7af42f..7c743df20b 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -44,11 +44,11 @@ clean:
# Important: distclean `src' last, otherwise Makefile.global
# will be gone too soon.
distclean maintainer-clean:
- -$(MAKE) -C doc $@
- -$(MAKE) -C contrib $@
- -$(MAKE) -C config $@
- -$(MAKE) -C src $@
- -rm -f config.cache config.log config.status GNUmakefile
+ $(MAKE) -C doc $@
+ $(MAKE) -C contrib $@
+ $(MAKE) -C config $@
+ $(MAKE) -C src $@
+ rm -f config.cache config.log config.status GNUmakefile
# Garbage from autoconf:
@rm -rf autom4te.cache/
@@ -72,7 +72,7 @@ ifeq ($(split-dist), yes)
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz
endif
dist:
- -rm -rf $(distdir)
+ rm -rf $(distdir)
$(distdir).tar: distdir
$(TAR) chf $@ $(distdir)
@@ -97,7 +97,7 @@ postgresql-test-$(VERSION).tar: distdir
$(TAR) cf $@ $(distdir)/src/test
distdir:
- -rm -rf $(distdir)* $(dummy)
+ rm -rf $(distdir)* $(dummy)
for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
file=`expr X$$x : 'X\./\(.*\)'`; \
if test -d "$(top_srcdir)/$$file" ; then \
@@ -116,7 +116,7 @@ distdir:
rm -f $(distdir)/README.CVS
distcheck: $(distdir).tar.gz
- -rm -rf $(dummy)
+ rm -rf $(dummy)
mkdir $(dummy)
$(GZIP) -d -c $< | $(TAR) xf -
install_prefix=`cd $(dummy) && pwd`; \
@@ -131,7 +131,7 @@ distcheck: $(distdir).tar.gz
$(MAKE) -C $(distdir) dist
# Room for improvement: Check here whether this distribution tarball
# is sufficiently similar to the original one.
- -rm -rf $(distdir) $(dummy)
+ rm -rf $(distdir) $(dummy)
@echo "Distribution integrity checks out."
.PHONY: dist distdir distcheck
diff --git a/doc/Makefile b/doc/Makefile
index 73cf658d23..2e2884e601 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -90,10 +90,10 @@ endif
uninstall:
ifdef found_html
- -rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | tar tf -))
+ rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | tar tf -))
endif
ifdef found_man
- -rm -f $(addprefix $(DESTDIR)$(mandir)/, $(shell gunzip -c $(srcdir)/man.tar.gz | tar tf - | sed -e 's,man$(sqlmansect_dummy)/,man$(sqlmansectnum)/,' -e 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/'))
+ rm -f $(addprefix $(DESTDIR)$(mandir)/, $(shell gunzip -c $(srcdir)/man.tar.gz | tar tf - | sed -e 's,man$(sqlmansect_dummy)/,man$(sqlmansectnum)/,' -e 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/'))
endif
diff --git a/src/Makefile b/src/Makefile
index 250bcd1d77..acefa7580b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -59,18 +59,18 @@ clean:
$(MAKE) -C test/thread $@
distclean maintainer-clean:
- -$(MAKE) -C port $@
- -$(MAKE) -C timezone $@
- -$(MAKE) -C backend $@
- -$(MAKE) -C backend/snowball $@
- -$(MAKE) -C include $@
- -$(MAKE) -C interfaces $@
- -$(MAKE) -C bin $@
- -$(MAKE) -C pl $@
- -$(MAKE) -C makefiles $@
- -$(MAKE) -C test $@
- -$(MAKE) -C tutorial NO_PGXS=1 $@
- -$(MAKE) -C test/thread $@
+ $(MAKE) -C port $@
+ $(MAKE) -C timezone $@
+ $(MAKE) -C backend $@
+ $(MAKE) -C backend/snowball $@
+ $(MAKE) -C include $@
+ $(MAKE) -C interfaces $@
+ $(MAKE) -C bin $@
+ $(MAKE) -C pl $@
+ $(MAKE) -C makefiles $@
+ $(MAKE) -C test $@
+ $(MAKE) -C tutorial NO_PGXS=1 $@
+ $(MAKE) -C test/thread $@
rm -f Makefile.port Makefile.global
diff --git a/src/backend/snowball/Makefile b/src/backend/snowball/Makefile
index 07f0d3096b..ce2067af5c 100644
--- a/src/backend/snowball/Makefile
+++ b/src/backend/snowball/Makefile
@@ -92,7 +92,8 @@ $(SQLSCRIPT): Makefile snowball_func.sql.in snowball.sql.in
ifeq ($(enable_shared), yes)
echo '-- Language-specific snowball dictionaries' > $@
cat $(srcdir)/snowball_func.sql.in >> $@
- @set $(LANGUAGES) ; \
+ @set -e; \
+ set $(LANGUAGES) ; \
while [ "$$#" -gt 0 ] ; \
do \
lang=$$1; shift; \
@@ -120,7 +121,8 @@ ifeq ($(enable_shared), yes)
$(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
endif
$(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
- @set $(LANGUAGES) ; \
+ @set -e; \
+ set $(LANGUAGES) ; \
while [ "$$#" -gt 0 ] ; \
do \
lang=$$1; shift; shift; \
@@ -135,7 +137,8 @@ installdirs:
uninstall:
rm -f '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
- @set $(LANGUAGES) ; \
+ @set -e; \
+ set $(LANGUAGES) ; \
while [ "$$#" -gt 0 ] ; \
do \
lang=$$1; shift; shift; \
diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile
index a797e3bdbf..aced4d1de7 100644
--- a/src/backend/utils/mb/conversion_procs/Makefile
+++ b/src/backend/utils/mb/conversion_procs/Makefile
@@ -164,7 +164,8 @@ all: $(SQLSCRIPT)
$(SQLSCRIPT): Makefile
ifeq ($(enable_shared), yes)
- @set $(CONVERSIONS) ; \
+ @set -e; \
+ set $(CONVERSIONS) ; \
while [ "$$#" -gt 0 ] ; \
do \
name=$$1;shift; \
@@ -182,7 +183,8 @@ else
endif
$(REGRESSION_SCRIPT): Makefile
- @cp regress_prolog $@; \
+ @set -e; \
+ cp regress_prolog $@; \
set $(CONVERSIONS) ; \
while [ "$$#" -gt 0 ] ; \
do \
@@ -210,5 +212,5 @@ uninstall:
clean distclean maintainer-clean:
rm -f $(SQLSCRIPT)
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
+ @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
diff --git a/src/bin/Makefile b/src/bin/Makefile
index 0f356bb29a..1388b30a0a 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -19,8 +19,5 @@ ifeq ($(PORTNAME), win32)
DIRS+=pgevent
endif
-all install installdirs uninstall distprep:
+all install installdirs uninstall distprep clean distclean maintainer-clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
-
-clean distclean maintainer-clean:
- -@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
diff --git a/src/interfaces/Makefile b/src/interfaces/Makefile
index 4de35c1140..7a46579314 100644
--- a/src/interfaces/Makefile
+++ b/src/interfaces/Makefile
@@ -14,13 +14,5 @@ include $(top_builddir)/src/Makefile.global
DIRS = libpq ecpg
-ALLDIRS = $(DIRS)
-
-all install installdirs uninstall distprep:
+all install installdirs uninstall distprep clean distclean maintainer-clean:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
-
-clean:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
-
-distclean maintainer-clean:
- @for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done
diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile
index c83144d895..71bfff672d 100644
--- a/src/interfaces/ecpg/Makefile
+++ b/src/interfaces/ecpg/Makefile
@@ -10,12 +10,12 @@ all install installdirs uninstall distprep:
$(MAKE) -C preproc $@
clean distclean maintainer-clean:
- -$(MAKE) -C include $@
- -$(MAKE) -C pgtypeslib $@
- -$(MAKE) -C ecpglib $@
- -$(MAKE) -C compatlib $@
- -$(MAKE) -C preproc $@
- -$(MAKE) -C test clean
+ $(MAKE) -C include $@
+ $(MAKE) -C pgtypeslib $@
+ $(MAKE) -C ecpglib $@
+ $(MAKE) -C compatlib $@
+ $(MAKE) -C preproc $@
+ $(MAKE) -C test clean
check checktcp installcheck: all
$(MAKE) -C test $@
diff --git a/src/pl/Makefile b/src/pl/Makefile
index b6eaee45c2..34614debbd 100644
--- a/src/pl/Makefile
+++ b/src/pl/Makefile
@@ -26,11 +26,8 @@ ifeq ($(with_tcl), yes)
DIRS += tcl
endif
-all install installdirs uninstall distprep:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
-
-clean distclean maintainer-clean:
- @for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
+all install installdirs uninstall distprep clean distclean maintainer-clean:
+ @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
# We'd like check operations to run all the subtests before failing.
check installcheck:
diff --git a/src/pl/plpgsql/Makefile b/src/pl/plpgsql/Makefile
index 11ca1791d0..bb41207f98 100644
--- a/src/pl/plpgsql/Makefile
+++ b/src/pl/plpgsql/Makefile
@@ -12,8 +12,5 @@ subdir = src/pl/plpgsql
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-all install installdirs uninstall distprep:
+all install installdirs uninstall distprep clean distclean maintainer-clean:
$(MAKE) -C src $@
-
-clean distclean maintainer-clean:
- -$(MAKE) -C src $@
diff --git a/src/test/bench/Makefile b/src/test/bench/Makefile
index 4649161473..655aa5ab8f 100644
--- a/src/test/bench/Makefile
+++ b/src/test/bench/Makefile
@@ -31,9 +31,9 @@ create.sql: create.source
bench.sql:
x=1; \
for i in `ls query[0-9][0-9]`; do \
- echo "select $$x as x" >> bench.sql; \
- cat $$i >> bench.sql; \
- x=`expr $$x + 1`; \
+ echo "select $$x as x" >> bench.sql && \
+ cat $$i >> bench.sql && \
+ x=`expr $$x + 1` || exit; \
done
runtest: $(OUTFILES)
diff --git a/src/test/locale/Makefile b/src/test/locale/Makefile
index 4faf53d257..8600281969 100644
--- a/src/test/locale/Makefile
+++ b/src/test/locale/Makefile
@@ -13,7 +13,7 @@ all: $(PROGS)
clean:
rm -f $(PROGS)
for d in $(DIRS); do \
- $(MAKE) -C $$d clean; \
+ $(MAKE) -C $$d clean || exit; \
done
check-%: all
diff --git a/src/test/locale/de_DE.ISO8859-1/Makefile b/src/test/locale/de_DE.ISO8859-1/Makefile
index 281014521e..fd8301928e 100644
--- a/src/test/locale/de_DE.ISO8859-1/Makefile
+++ b/src/test/locale/de_DE.ISO8859-1/Makefile
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
all:
- -@echo "make: Nothing to be done for \`all'."
test:
- @./runall
+ ./runall
clean:
rm -f *.out
diff --git a/src/test/locale/gr_GR.ISO8859-7/Makefile b/src/test/locale/gr_GR.ISO8859-7/Makefile
index 281014521e..fd8301928e 100644
--- a/src/test/locale/gr_GR.ISO8859-7/Makefile
+++ b/src/test/locale/gr_GR.ISO8859-7/Makefile
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
all:
- -@echo "make: Nothing to be done for \`all'."
test:
- @./runall
+ ./runall
clean:
rm -f *.out
diff --git a/src/test/locale/koi8-r/Makefile b/src/test/locale/koi8-r/Makefile
index 281014521e..fd8301928e 100644
--- a/src/test/locale/koi8-r/Makefile
+++ b/src/test/locale/koi8-r/Makefile
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
all:
- -@echo "make: Nothing to be done for \`all'."
test:
- @./runall
+ ./runall
clean:
rm -f *.out
diff --git a/src/test/locale/koi8-to-win1251/Makefile b/src/test/locale/koi8-to-win1251/Makefile
index 281014521e..fd8301928e 100644
--- a/src/test/locale/koi8-to-win1251/Makefile
+++ b/src/test/locale/koi8-to-win1251/Makefile
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
all:
- -@echo "make: Nothing to be done for \`all'."
test:
- @./runall
+ ./runall
clean:
rm -f *.out
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index bfc97fab4c..6441f2b568 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -133,7 +133,7 @@ all-spi:
# Tablespace setup
.PHONY: tablespace-setup
tablespace-setup:
- -rm -rf ./testtablespace
+ rm -rf ./testtablespace
mkdir ./testtablespace
##