Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8c87cc3

Browse files
committed
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.
1 parent 184c42d commit 8c87cc3

File tree

17 files changed

+66
-98
lines changed

17 files changed

+66
-98
lines changed

GNUmakefile.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# PostgreSQL top level makefile
33
#
4-
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.46 2007/02/09 15:55:57 petere Exp $
4+
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.47 2008/03/18 16:24:50 petere Exp $
55
#
66

77
subdir =
@@ -44,11 +44,11 @@ clean:
4444
# Important: distclean `src' last, otherwise Makefile.global
4545
# will be gone too soon.
4646
distclean maintainer-clean:
47-
-$(MAKE) -C doc $@
48-
-$(MAKE) -C contrib $@
49-
-$(MAKE) -C config $@
50-
-$(MAKE) -C src $@
51-
-rm -f config.cache config.log config.status GNUmakefile
47+
$(MAKE) -C doc $@
48+
$(MAKE) -C contrib $@
49+
$(MAKE) -C config $@
50+
$(MAKE) -C src $@
51+
rm -f config.cache config.log config.status GNUmakefile
5252
# Garbage from autoconf:
5353
@rm -rf autom4te.cache/
5454

@@ -72,7 +72,7 @@ ifeq ($(split-dist), yes)
7272
dist: postgresql-base-$(VERSION).tar.gz postgresql-docs-$(VERSION).tar.gz postgresql-opt-$(VERSION).tar.gz postgresql-test-$(VERSION).tar.gz
7373
endif
7474
dist:
75-
-rm -rf $(distdir)
75+
rm -rf $(distdir)
7676

7777
$(distdir).tar: distdir
7878
$(TAR) chf $@ $(distdir)
@@ -97,7 +97,7 @@ postgresql-test-$(VERSION).tar: distdir
9797
$(TAR) cf $@ $(distdir)/src/test
9898

9999
distdir:
100-
-rm -rf $(distdir)* $(dummy)
100+
rm -rf $(distdir)* $(dummy)
101101
for x in `cd $(top_srcdir) && find . -name CVS -prune -o -print`; do \
102102
file=`expr X$$x : 'X\./\(.*\)'`; \
103103
if test -d "$(top_srcdir)/$$file" ; then \
@@ -116,7 +116,7 @@ distdir:
116116
rm -f $(distdir)/README.CVS
117117

118118
distcheck: $(distdir).tar.gz
119-
-rm -rf $(dummy)
119+
rm -rf $(dummy)
120120
mkdir $(dummy)
121121
$(GZIP) -d -c $< | $(TAR) xf -
122122
install_prefix=`cd $(dummy) && pwd`; \
@@ -131,7 +131,7 @@ distcheck: $(distdir).tar.gz
131131
$(MAKE) -C $(distdir) dist
132132
# Room for improvement: Check here whether this distribution tarball
133133
# is sufficiently similar to the original one.
134-
-rm -rf $(distdir) $(dummy)
134+
rm -rf $(distdir) $(dummy)
135135
@echo "Distribution integrity checks out."
136136

137137
.PHONY: dist distdir distcheck

doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/doc/Makefile,v 1.30 2008/02/17 16:36:42 petere Exp $
7+
# $PostgreSQL: pgsql/doc/Makefile,v 1.31 2008/03/18 16:24:50 petere Exp $
88
#
99
#----------------------------------------------------------------------------
1010

@@ -90,10 +90,10 @@ endif
9090

9191
uninstall:
9292
ifdef found_html
93-
-rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | tar tf -))
93+
rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | tar tf -))
9494
endif
9595
ifdef found_man
96-
-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)/'))
96+
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)/'))
9797
endif
9898

9999

src/Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/Makefile,v 1.42 2007/08/21 01:11:12 tgl Exp $
7+
# $PostgreSQL: pgsql/src/Makefile,v 1.43 2008/03/18 16:24:50 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -59,18 +59,18 @@ clean:
5959
$(MAKE) -C test/thread $@
6060

6161
distclean maintainer-clean:
62-
-$(MAKE) -C port $@
63-
-$(MAKE) -C timezone $@
64-
-$(MAKE) -C backend $@
65-
-$(MAKE) -C backend/snowball $@
66-
-$(MAKE) -C include $@
67-
-$(MAKE) -C interfaces $@
68-
-$(MAKE) -C bin $@
69-
-$(MAKE) -C pl $@
70-
-$(MAKE) -C makefiles $@
71-
-$(MAKE) -C test $@
72-
-$(MAKE) -C tutorial NO_PGXS=1 $@
73-
-$(MAKE) -C test/thread $@
62+
$(MAKE) -C port $@
63+
$(MAKE) -C timezone $@
64+
$(MAKE) -C backend $@
65+
$(MAKE) -C backend/snowball $@
66+
$(MAKE) -C include $@
67+
$(MAKE) -C interfaces $@
68+
$(MAKE) -C bin $@
69+
$(MAKE) -C pl $@
70+
$(MAKE) -C makefiles $@
71+
$(MAKE) -C test $@
72+
$(MAKE) -C tutorial NO_PGXS=1 $@
73+
$(MAKE) -C test/thread $@
7474
rm -f Makefile.port Makefile.global
7575

7676

src/backend/snowball/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for src/backend/snowball
44
#
5-
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.4 2007/10/23 20:46:12 tgl Exp $
5+
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.5 2008/03/18 16:24:50 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -92,7 +92,8 @@ $(SQLSCRIPT): Makefile snowball_func.sql.in snowball.sql.in
9292
ifeq ($(enable_shared), yes)
9393
echo '-- Language-specific snowball dictionaries' > $@
9494
cat $(srcdir)/snowball_func.sql.in >> $@
95-
@set $(LANGUAGES) ; \
95+
@set -e; \
96+
set $(LANGUAGES) ; \
9697
while [ "$$#" -gt 0 ] ; \
9798
do \
9899
lang=$$1; shift; \
@@ -120,7 +121,8 @@ ifeq ($(enable_shared), yes)
120121
$(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
121122
endif
122123
$(INSTALL_DATA) $(SQLSCRIPT) '$(DESTDIR)$(datadir)'
123-
@set $(LANGUAGES) ; \
124+
@set -e; \
125+
set $(LANGUAGES) ; \
124126
while [ "$$#" -gt 0 ] ; \
125127
do \
126128
lang=$$1; shift; shift; \
@@ -135,7 +137,8 @@ installdirs:
135137
uninstall:
136138
rm -f '$(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)'
137139
rm -f '$(DESTDIR)$(datadir)/$(SQLSCRIPT)'
138-
@set $(LANGUAGES) ; \
140+
@set -e; \
141+
set $(LANGUAGES) ; \
139142
while [ "$$#" -gt 0 ] ; \
140143
do \
141144
lang=$$1; shift; shift; \

src/backend/utils/mb/conversion_procs/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for utils/mb/conversion_procs
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.18 2007/03/25 11:56:02 ishii Exp $
7+
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.19 2008/03/18 16:24:50 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -164,7 +164,8 @@ all: $(SQLSCRIPT)
164164

165165
$(SQLSCRIPT): Makefile
166166
ifeq ($(enable_shared), yes)
167-
@set $(CONVERSIONS) ; \
167+
@set -e; \
168+
set $(CONVERSIONS) ; \
168169
while [ "$$#" -gt 0 ] ; \
169170
do \
170171
name=$$1;shift; \
@@ -182,7 +183,8 @@ else
182183
endif
183184

184185
$(REGRESSION_SCRIPT): Makefile
185-
@cp regress_prolog $@; \
186+
@set -e; \
187+
cp regress_prolog $@; \
186188
set $(CONVERSIONS) ; \
187189
while [ "$$#" -gt 0 ] ; \
188190
do \
@@ -210,5 +212,5 @@ uninstall:
210212

211213
clean distclean maintainer-clean:
212214
rm -f $(SQLSCRIPT)
213-
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
215+
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
214216

src/bin/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/Makefile,v 1.51 2008/01/01 19:45:55 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/Makefile,v 1.52 2008/03/18 16:24:50 petere Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -19,8 +19,5 @@ ifeq ($(PORTNAME), win32)
1919
DIRS+=pgevent
2020
endif
2121

22-
all install installdirs uninstall distprep:
22+
all install installdirs uninstall distprep clean distclean maintainer-clean:
2323
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
24-
25-
clean distclean maintainer-clean:
26-
-@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done

src/interfaces/Makefile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/Makefile,v 1.55 2007/02/09 15:55:59 petere Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/Makefile,v 1.56 2008/03/18 16:24:50 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -14,13 +14,5 @@ include $(top_builddir)/src/Makefile.global
1414

1515
DIRS = libpq ecpg
1616

17-
ALLDIRS = $(DIRS)
18-
19-
all install installdirs uninstall distprep:
17+
all install installdirs uninstall distprep clean distclean maintainer-clean:
2018
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
21-
22-
clean:
23-
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
24-
25-
distclean maintainer-clean:
26-
@for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done

src/interfaces/ecpg/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ all install installdirs uninstall distprep:
1010
$(MAKE) -C preproc $@
1111

1212
clean distclean maintainer-clean:
13-
-$(MAKE) -C include $@
14-
-$(MAKE) -C pgtypeslib $@
15-
-$(MAKE) -C ecpglib $@
16-
-$(MAKE) -C compatlib $@
17-
-$(MAKE) -C preproc $@
18-
-$(MAKE) -C test clean
13+
$(MAKE) -C include $@
14+
$(MAKE) -C pgtypeslib $@
15+
$(MAKE) -C ecpglib $@
16+
$(MAKE) -C compatlib $@
17+
$(MAKE) -C preproc $@
18+
$(MAKE) -C test clean
1919

2020
check checktcp installcheck: all
2121
$(MAKE) -C test $@

src/pl/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/pl/Makefile,v 1.26 2007/06/01 19:38:07 tgl Exp $
7+
# $PostgreSQL: pgsql/src/pl/Makefile,v 1.27 2008/03/18 16:24:50 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -26,11 +26,8 @@ ifeq ($(with_tcl), yes)
2626
DIRS += tcl
2727
endif
2828

29-
all install installdirs uninstall distprep:
30-
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
31-
32-
clean distclean maintainer-clean:
33-
@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
29+
all install installdirs uninstall distprep clean distclean maintainer-clean:
30+
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
3431

3532
# We'd like check operations to run all the subtests before failing.
3633
check installcheck:

src/pl/plpgsql/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/pl/plpgsql/Makefile,v 1.8 2003/11/29 19:52:12 pgsql Exp $
7+
# $PostgreSQL: pgsql/src/pl/plpgsql/Makefile,v 1.9 2008/03/18 16:24:50 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/pl/plpgsql
1212
top_builddir = ../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
all install installdirs uninstall distprep:
15+
all install installdirs uninstall distprep clean distclean maintainer-clean:
1616
$(MAKE) -C src $@
17-
18-
clean distclean maintainer-clean:
19-
-$(MAKE) -C src $@

src/test/bench/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.15 2008/01/01 19:46:00 momjian Exp $
11+
# $PostgreSQL: pgsql/src/test/bench/Makefile,v 1.16 2008/03/18 16:24:50 petere Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -31,9 +31,9 @@ create.sql: create.source
3131
bench.sql:
3232
x=1; \
3333
for i in `ls query[0-9][0-9]`; do \
34-
echo "select $$x as x" >> bench.sql; \
35-
cat $$i >> bench.sql; \
36-
x=`expr $$x + 1`; \
34+
echo "select $$x as x" >> bench.sql && \
35+
cat $$i >> bench.sql && \
36+
x=`expr $$x + 1` || exit; \
3737
done
3838

3939
runtest: $(OUTFILES)

src/test/locale/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/test/locale/Makefile,v 1.9 2003/11/29 19:52:14 pgsql Exp $
1+
# $PostgreSQL: pgsql/src/test/locale/Makefile,v 1.10 2008/03/18 16:24:50 petere Exp $
22

33
subdir = src/test/locale
44
top_builddir = ../../..
@@ -13,7 +13,7 @@ all: $(PROGS)
1313
clean:
1414
rm -f $(PROGS)
1515
for d in $(DIRS); do \
16-
$(MAKE) -C $$d clean; \
16+
$(MAKE) -C $$d clean || exit; \
1717
done
1818

1919
check-%: all
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#
2-
# Makefile for example programs
3-
#
4-
51
all:
6-
-@echo "make: Nothing to be done for \`all'."
72

83
test:
9-
@./runall
4+
./runall
105

116
clean:
127
rm -f *.out
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#
2-
# Makefile for example programs
3-
#
4-
51
all:
6-
-@echo "make: Nothing to be done for \`all'."
72

83
test:
9-
@./runall
4+
./runall
105

116
clean:
127
rm -f *.out

src/test/locale/koi8-r/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#
2-
# Makefile for example programs
3-
#
4-
51
all:
6-
-@echo "make: Nothing to be done for \`all'."
72

83
test:
9-
@./runall
4+
./runall
105

116
clean:
127
rm -f *.out
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#
2-
# Makefile for example programs
3-
#
4-
51
all:
6-
-@echo "make: Nothing to be done for \`all'."
72

83
test:
9-
@./runall
4+
./runall
105

116
clean:
127
rm -f *.out

0 commit comments

Comments
 (0)