]> granicus.if.org Git - postgresql/commitdiff
Catch all errors in for and while loops in makefiles. Don't ignore any
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 18 Mar 2008 16:24:50 +0000 (16:24 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 18 Mar 2008 16:24:50 +0000 (16:24 +0000)
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.

17 files changed:
GNUmakefile.in
doc/Makefile
src/Makefile
src/backend/snowball/Makefile
src/backend/utils/mb/conversion_procs/Makefile
src/bin/Makefile
src/interfaces/Makefile
src/interfaces/ecpg/Makefile
src/pl/Makefile
src/pl/plpgsql/Makefile
src/test/bench/Makefile
src/test/locale/Makefile
src/test/locale/de_DE.ISO8859-1/Makefile
src/test/locale/gr_GR.ISO8859-7/Makefile
src/test/locale/koi8-r/Makefile
src/test/locale/koi8-to-win1251/Makefile
src/test/regress/GNUmakefile

index f7bcc6729caa5695359e8d74ae241d3cdb4a6930..c71f8a608830cdf798752370479481826cd501f8 100644 (file)
@@ -1,7 +1,7 @@
 #
 # PostgreSQL top level makefile
 #
-# $PostgreSQL: pgsql/GNUmakefile.in,v 1.46 2007/02/09 15:55:57 petere Exp $
+# $PostgreSQL: pgsql/GNUmakefile.in,v 1.47 2008/03/18 16:24:50 petere Exp $
 #
 
 subdir =
@@ -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
index ea5b34825e103908638a76b2a5d772184eb77f14..151bc2ad1d68aecf7000f7b4a849a4ef535184e3 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/doc/Makefile,v 1.30 2008/02/17 16:36:42 petere Exp $
+# $PostgreSQL: pgsql/doc/Makefile,v 1.31 2008/03/18 16:24:50 petere Exp $
 #
 #----------------------------------------------------------------------------
 
@@ -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
 
 
index 8d66bf62cacd4631f2e074c2f774637703c8753a..61950967fde651165d9bcbb986448722e99d1ca7 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/Makefile,v 1.42 2007/08/21 01:11:12 tgl Exp $
+# $PostgreSQL: pgsql/src/Makefile,v 1.43 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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
 
 
index ba0c60db28a49e9a28fdeaed0c6e87c53cef4abc..466a507c0896ac4d983b3c45587bc09641efd135 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Makefile for src/backend/snowball
 #
-# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.4 2007/10/23 20:46:12 tgl Exp $
+# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.5 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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;  \
index 57c8cde5d33de8cc42e1f2af26f6e314c692c99e..2bb45d84348d6c8bbbdab43b95e9e1a9bde849ac 100644 (file)
@@ -4,7 +4,7 @@
 #    Makefile for utils/mb/conversion_procs
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.18 2007/03/25 11:56:02 ishii Exp $
+#    $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.19 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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
 
index ec8f7ce9eaca1a042732fe61ffb9993528bce354..56389351272bf5c52ae68d3cd1f20f4f5413a191 100644 (file)
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/bin/Makefile,v 1.51 2008/01/01 19:45:55 momjian Exp $
+# $PostgreSQL: pgsql/src/bin/Makefile,v 1.52 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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
index db0e4ff671692d9ab8dcd3b84f2578d34021df5f..dd57c18c3edc8456a1a54e3e18a2e642e120b863 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/interfaces/Makefile,v 1.55 2007/02/09 15:55:59 petere Exp $
+# $PostgreSQL: pgsql/src/interfaces/Makefile,v 1.56 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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
index c83144d89594e2c9ca10a20900a05ff25595b73f..71bfff672d7c77c622db949c1f5dbc82dd6cd196 100644 (file)
@@ -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 $@
index 4a0f3654721a45d2c1352e02d3bf8ecc5c7e63a6..fa06459a9b51aa8d9c715b1190568d48374428dc 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/pl/Makefile,v 1.26 2007/06/01 19:38:07 tgl Exp $
+# $PostgreSQL: pgsql/src/pl/Makefile,v 1.27 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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:
index 118636cae374e8defedf36bd7ea0fc474c7d1fad..2f1298c2582a84cd15495d77f2133ab26dfeb1a1 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/pl/plpgsql/Makefile,v 1.8 2003/11/29 19:52:12 pgsql Exp $
+# $PostgreSQL: pgsql/src/pl/plpgsql/Makefile,v 1.9 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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 $@
index c528fc015c3734992f819e12914ba4f22048555c..4b0d713cb8c960efbb1abd939e461f50ec73c396 100644 (file)
@@ -8,7 +8,7 @@
 #
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.15 2008/01/01 19:46:00 momjian Exp $
+#    $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.16 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -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)
index d34eedfce103eff11595ea52726fcd19a39e0940..295f049ce83c5e9abba9447a798d7b1c252489f3 100644 (file)
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/test/locale/Makefile,v 1.9 2003/11/29 19:52:14 pgsql Exp $
+# $PostgreSQL: pgsql/src/test/locale/Makefile,v 1.10 2008/03/18 16:24:50 petere Exp $
 
 subdir = src/test/locale
 top_builddir = ../../..
@@ -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
index 281014521ef12a20e88338a995b1cd85489bac9f..fd8301928eff14470533410e41bd952348bb3f4c 100644 (file)
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
 all: 
-       -@echo "make: Nothing to be done for \`all'."
 
 test: 
-       @./runall
+       ./runall
 
 clean: 
        rm -f *.out
index 281014521ef12a20e88338a995b1cd85489bac9f..fd8301928eff14470533410e41bd952348bb3f4c 100644 (file)
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
 all: 
-       -@echo "make: Nothing to be done for \`all'."
 
 test: 
-       @./runall
+       ./runall
 
 clean: 
        rm -f *.out
index 281014521ef12a20e88338a995b1cd85489bac9f..fd8301928eff14470533410e41bd952348bb3f4c 100644 (file)
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
 all: 
-       -@echo "make: Nothing to be done for \`all'."
 
 test: 
-       @./runall
+       ./runall
 
 clean: 
        rm -f *.out
index 281014521ef12a20e88338a995b1cd85489bac9f..fd8301928eff14470533410e41bd952348bb3f4c 100644 (file)
@@ -1,12 +1,7 @@
-#
-# Makefile for example programs
-#
-
 all: 
-       -@echo "make: Nothing to be done for \`all'."
 
 test: 
-       @./runall
+       ./runall
 
 clean: 
        rm -f *.out
index 4d19f9c0bbd39b38607db401aeb77a0b527c2b0a..3920e3da21039a7e402b8c24fe326f3f82fa3ff4 100644 (file)
@@ -6,7 +6,7 @@
 # Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.71 2008/01/01 19:46:00 momjian Exp $
+# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.72 2008/03/18 16:24:50 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -133,7 +133,7 @@ all-spi:
 # Tablespace setup
 .PHONY: tablespace-setup
 tablespace-setup:
-       -rm -rf ./testtablespace
+       rm -rf ./testtablespace
        mkdir ./testtablespace
 
 ##