2 # Copyright (C) 2009, 2010 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)
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, languages other than C.
18 # This test partly overlaps with other silent*.test, but it serves as
19 # a stress test by using many different languages at once -- so don't
20 # remove this test script.
22 # FIXME: generic C++/Fortran compilers should suffice here
23 required
='g++ gfortran flex bison'
28 # Avoids too much code duplication.
29 do_and_check_silent_build
()
32 --rebuild) rebuild
=true
;;
36 $MAKE >stdout ||
{ cat stdout
; Exit
1; }
39 $EGREP ' (-c|-o)' stdout
&& Exit
1
40 $EGREP '(mv|ylwrap) ' stdout
&& Exit
1
42 grep 'CXX .*foo1\.' stdout
43 grep 'CXX .*baz1\.' stdout
44 grep 'FC .*foo2\.' stdout
45 grep 'FC .*baz2\.' stdout
46 grep 'F77 .*foo3\.' stdout
47 grep 'F77 .*baz3\.' stdout
48 grep ' CC .*foo5\.' stdout
49 grep ' CC .*baz5\.' stdout
50 grep ' CC .*foo6\.' stdout
51 grep ' CC .*baz6\.' stdout
53 grep 'CXXLD .*foo' stdout
54 grep 'CCLD .*bar' stdout
55 grep 'CXXLD .*baz' stdout
56 grep 'CCLD .*bla' stdout
58 if $rebuild; then :; else
59 grep 'YACC .*foo6\.' stdout
60 grep 'YACC .*baz6\.' stdout
61 grep 'LEX .*foo5\.' stdout
62 grep 'LEX .*baz5\.' stdout
68 # Avoids too much code duplication.
69 do_and_check_verbose_build
()
73 --rebuild) rebuild
=true
;;
77 $MAKE V
=1 >stdout ||
{ cat stdout
; Exit
1; }
83 $EGREP '(CC|CXX|FC|F77|LD) ' stdout
&& Exit
1
85 if $rebuild; then :; else
87 $EGREP '(LEX|YACC) ' stdout
&& Exit
1
95 cat >>configure.
in <<'EOF'
103 AC_CONFIG_FILES([sub/Makefile])
107 cat > Makefile.am
<<'EOF'
108 # Need generic and non-generic rules.
109 bin_PROGRAMS = foo bar fo2
110 bar_CFLAGS = $(AM_CFLAGS)
111 foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y
112 fo2_SOURCES = $(foo_SOURCES)
113 fo2_CPPFLAGS = $(AM_CPPFLAGS)
114 fo2_FFLAGS = $(AM_FFLAGS)
115 fo2_FCFLAGS = $(AM_FCFLAGS)
119 BUILT_SOURCES = foo6.h
122 cat > sub
/Makefile.am
<<'EOF'
123 AUTOMAKE_OPTIONS = subdir-objects
124 # Need generic and non-generic rules.
125 bin_PROGRAMS = baz bla ba2
126 bla_CFLAGS = $(AM_CFLAGS)
127 baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y
128 ba2_SOURCES = $(baz_SOURCES)
129 ba2_CPPFLAGS = $(AM_CPPFLAGS)
130 ba2_FFLAGS = $(AM_FFLAGS)
131 ba2_FCFLAGS = $(AM_FCFLAGS)
134 BUILT_SOURCES = baz6.h
137 cat > foo1.cpp
<<'EOF'
143 cat > foo2.f90
<<'EOF'
161 void yyerror (char *s) {}
165 fubar
: 'f' 'o' 'o' 'b' 'a' 'r' EOF
{};
168 cp foo1.cpp sub
/baz.c
169 cp foo1.cpp sub
/bla.c
170 cp foo1.cpp sub
/baz1.cpp
171 cp foo2.f90 sub
/baz2.f90
177 $AUTOMAKE --add-missing
180 # configure once for fastdep, once for non-fastdep, once for nodep
183 am_cv_CC_dependencies_compiler_type
=gcc \
184 --disable-dependency-tracking
187 .
/configure
$config_args --enable-silent-rules
189 do_and_check_silent_build
190 # Cleaning and then rebuilding with the same V flag (and without
191 # removing the generated sources in between) shouldn't trigger a
192 # different set of rules.
194 do_and_check_silent_build
--rebuild
196 # Ensure a clean rebuild.
198 # This is required, since these files are not removed by `make clean'
199 # (as dictated by the GNU Coding Standards).
200 rm -f foo5.c foo6.
[ch
] sub
/baz5.c sub
/baz6.
[ch
]
202 do_and_check_verbose_build
203 # Cleaning and then rebuilding with the same V flag (and without
204 # removing the generated sources in between) shouldn't trigger a
205 # different set of rules.
207 do_and_check_verbose_build
--rebuild
209 # Ensure a clean reconfiguration/rebuild.
211 $MAKE maintainer-clean