Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / silent6.test
1 #!/bin/sh
2 # Copyright (C) 2009, 2010, 2011 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 set -e
22
23 cat >>configure.in <<'EOF'
24 AM_SILENT_RULES
25 AC_OUTPUT
26 EOF
27
28 cat > Makefile.am <<'EOF'
29 my_verbose = $(my_verbose_$(V))
30 my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
31 my_verbose_0 = @echo GEN $@;
32
33 all-local: foo
34
35 foo: foo.in
36         $(my_verbose)cp $(srcdir)/foo.in $@
37 EXTRA_DIST = foo.in
38 CLEANFILES = foo
39 EOF
40
41 : >foo.in
42
43 $ACLOCAL
44 $AUTOMAKE --add-missing
45 $AUTOCONF
46
47 ./configure --enable-silent-rules
48 $MAKE >stdout || { cat stdout; Exit 1; }
49 cat stdout
50 grep '^ *GEN foo *$' stdout
51 grep 'cp ' stdout && Exit 1
52
53 $MAKE clean
54 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
55 cat stdout
56 grep 'GEN ' stdout && Exit 1
57 grep 'cp \.*/foo\.in foo' stdout
58
59 $MAKE distclean
60
61 ./configure --disable-silent-rules
62 $MAKE >stdout || { cat stdout; Exit 1; }
63 cat stdout
64 grep 'GEN ' stdout && Exit 1
65 grep 'cp \.*/foo\.in foo' stdout
66
67 $MAKE clean
68 $MAKE V=0 >stdout || { cat stdout; Exit 1; }
69 cat stdout
70 grep '^ *GEN foo *$' stdout
71 grep 'cp ' stdout && Exit 1
72
73 $MAKE distclean
74
75 $sleep
76 # Things should also work with -Wall in AM_INIT_AUTOMAKE.
77 cat > configure.in <<'END'
78 AC_INIT([silent6], [1.0])
79 AM_INIT_AUTOMAKE([-Wall])
80 AC_CONFIG_FILES([Makefile])
81 END
82
83 $ACLOCAL
84 AUTOMAKE_fails
85 $AUTOMAKE -Wno-error
86
87 # AM_SILENT_RULES should turn off the warning
88 $sleep
89 echo 'AM_SILENT_RULES' >> configure.in
90 $ACLOCAL
91 $AUTOMAKE
92 grep 'AM_V_GEN' Makefile.in
93 $AUTOMAKE --force -Wno-all -Wportability
94 grep 'AM_V_GEN' Makefile.in
95
96 # The `silent-rules' option to AM_INIT_AUTOMAKE should work likewise.
97 $sleep
98 cat > configure.in <<'END'
99 AC_INIT([silent6], [1.0])
100 AM_INIT_AUTOMAKE([silent-rules])
101 AC_CONFIG_FILES([Makefile])
102 END
103 $ACLOCAL
104 $AUTOMAKE
105 grep 'AM_V_GEN' Makefile.in
106 $AUTOMAKE --force -Wno-all -Wportability
107 grep 'AM_V_GEN' Makefile.in
108
109 :