news: dependency tracking for Portland Group Compilers is now supported
[automake.git] / t / silent.sh
blob639bef466a3eaf891ec0da009fa1df1727b9aef9
1 #!/bin/sh
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
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.
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.
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/>.
17 # Check silent-rules mode, without libtool, standard depmode case.
19 # Please keep this file in sync with silent2.test.
21 required=cc
22 . ./defs || exit 1
24 mkdir sub
26 cat >>configure.ac <<'EOF'
27 AM_SILENT_RULES
28 AC_CONFIG_FILES([sub/Makefile])
29 AC_PROG_CC
30 AM_PROG_CC_C_O
31 AC_OUTPUT
32 EOF
34 cat > Makefile.am <<'EOF'
35 # Need generic and non-generic rules.
36 bin_PROGRAMS = foo bar
37 bar_CFLAGS = $(AM_CFLAGS)
38 SUBDIRS = sub
39 EOF
41 cat > sub/Makefile.am <<'EOF'
42 AUTOMAKE_OPTIONS = subdir-objects
43 # Need generic and non-generic rules.
44 bin_PROGRAMS = baz bla
45 bla_CFLAGS = $(AM_CFLAGS)
46 EOF
48 cat > foo.c <<'EOF'
49 int main ()
51 return 0;
53 EOF
54 cp foo.c bar.c
55 cp foo.c sub/baz.c
56 cp foo.c sub/bla.c
58 $ACLOCAL
59 $AUTOMAKE --add-missing
60 $AUTOCONF
62 ./configure --enable-silent-rules
63 $MAKE >stdout || { cat stdout; exit 1; }
64 cat stdout
65 $EGREP ' (-c|-o)' stdout && exit 1
66 grep 'mv ' stdout && exit 1
67 grep 'CC .*foo\.' stdout
68 grep 'CC .*bar\.' stdout
69 grep 'CC .*baz\.' stdout
70 grep 'CC .*bla\.' stdout
71 grep 'CCLD .*foo' stdout
72 grep 'CCLD .*bar' stdout
73 grep 'CCLD .*baz' stdout
74 grep 'CCLD .*bla' stdout
76 $MAKE clean
77 $MAKE V=1 >stdout || { cat stdout; exit 1; }
78 cat stdout
79 grep ' -c' stdout
80 grep ' -o foo' stdout
81 $EGREP '(CC|LD) ' stdout && exit 1