cosmetics: remove a couple of extra whitespaces in tests
[platform/upstream/automake.git] / t / silent-c.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2013 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 silent-rules mode for C, without libtool, both with and without
18 # automatic dependency tracking.
19
20 required=cc
21 . test-init.sh
22
23 mkdir sub
24
25 cat >>configure.ac <<'EOF'
26 AC_CONFIG_FILES([sub/Makefile])
27 AC_PROG_CC
28 AM_PROG_CC_C_O
29 AC_OUTPUT
30 EOF
31
32 cat > Makefile.am <<'EOF'
33 # Need generic and non-generic rules.
34 bin_PROGRAMS = foo bar
35 bar_CFLAGS = $(AM_CFLAGS)
36 SUBDIRS = sub
37 EOF
38
39 cat > sub/Makefile.am <<'EOF'
40 AUTOMAKE_OPTIONS = subdir-objects
41 # Need generic and non-generic rules.
42 bin_PROGRAMS = baz bla
43 bla_CFLAGS = $(AM_CFLAGS)
44 EOF
45
46 cat > foo.c <<'EOF'
47 int main ()
48 {
49   return 0;
50 }
51 EOF
52 cp foo.c bar.c
53 cp foo.c sub/baz.c
54 cp foo.c sub/bla.c
55
56 $ACLOCAL
57 $AUTOMAKE --add-missing
58 $AUTOCONF
59
60 for config_args in \
61   '--enable-dependency-tracking' \
62   '--disable-dependency-tracking' \
63 ; do
64
65   ./configure --enable-silent-rules $config_args
66
67   $MAKE >stdout || { cat stdout; exit 1; }
68   cat stdout
69   $EGREP ' (-c|-o)' stdout && exit 1
70   grep 'mv ' stdout && exit 1
71   grep 'CC .*foo\.' stdout
72   grep 'CC .*bar\.' stdout
73   grep 'CC .*baz\.' stdout
74   grep 'CC .*bla\.' stdout
75   grep 'CCLD .*foo' stdout
76   grep 'CCLD .*bar' stdout
77   grep 'CCLD .*baz' stdout
78   grep 'CCLD .*bla' stdout
79
80   $MAKE clean
81   $MAKE V=1 >stdout || { cat stdout; exit 1; }
82   cat stdout
83   grep ' -c' stdout
84   grep ' -o foo' stdout
85   $EGREP '(CC|LD) ' stdout && exit 1
86
87   $MAKE distclean
88
89 done
90
91 :