Merge branch 'maint'
[platform/upstream/automake.git] / t / silent6.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Check user extensibility of silent-rules mode.
18
19 . ./defs || Exit 1
20
21 cat >>configure.ac <<'EOF'
22 AC_OUTPUT
23 EOF
24
25 cat > Makefile.am <<'EOF'
26 AUTOMAKE_OPTIONS = -Wno-portability-recursive
27
28 my_verbose = $(my_verbose_$(V))
29 my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
30 my_verbose_0 = @echo GEN $@;
31
32 all-local: foo
33
34 foo: foo.in
35         $(my_verbose)cp $(srcdir)/foo.in $@
36 EXTRA_DIST = foo.in
37 CLEANFILES = foo
38 EOF
39
40 : >foo.in
41
42 $ACLOCAL
43 $AUTOMAKE --add-missing
44 $AUTOCONF
45
46 ./configure --enable-silent-rules
47 $MAKE >stdout || { cat stdout; Exit 1; }
48 cat stdout
49 grep '^ *GEN foo *$' stdout
50 grep 'cp ' stdout && Exit 1
51
52 $MAKE clean
53 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
54 cat stdout
55 grep 'GEN ' stdout && Exit 1
56 grep 'cp \.*/foo\.in foo' stdout
57
58 $MAKE distclean
59
60 ./configure --disable-silent-rules
61 $MAKE >stdout || { cat stdout; Exit 1; }
62 cat stdout
63 grep 'GEN ' stdout && Exit 1
64 grep 'cp \.*/foo\.in foo' stdout
65
66 $MAKE clean
67 $MAKE V=0 >stdout || { cat stdout; Exit 1; }
68 cat stdout
69 grep '^ *GEN foo *$' stdout
70 grep 'cp ' stdout && Exit 1
71
72 :