2 # Copyright (C) 2010, 2011 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 for Lex, forcing gcc depmode.
18 # Keep this in sync with sister test `silent-lex-generic.test'.
27 cat >>configure.
in <<'EOF'
31 AC_CONFIG_FILES([sub/Makefile])
35 cat > Makefile.am
<<'EOF'
36 # Need generic and non-generic rules.
37 bin_PROGRAMS = foo1 foo2
39 foo2_SOURCES = $(foo1_SOURCES)
40 foo2_CFLAGS = $(AM_CFLAGS)
45 cat > sub
/Makefile.am
<<'EOF'
46 AUTOMAKE_OPTIONS = subdir-objects
47 # Need generic and non-generic rules.
48 bin_PROGRAMS = bar1 bar2
50 bar2_SOURCES = $(bar1_SOURCES)
51 bar2_CFLAGS = $(AM_CFLAGS)
60 /* Avoid possible link errors.
*/
61 int yywrap
(void
) { return 1; }
62 int main
(void
) { return 0; }
67 $AUTOMAKE --add-missing
70 # Force gcc ("fast") depmode.
71 # This apparently useless "for" loop is here to simplify the syncing
72 # with sister test `silent-lex-gcc.test'.
74 am_cv_CC_dependencies_compiler_type
=gcc
76 .
/configure
$config_args --enable-silent-rules
78 $MAKE >stdout ||
{ cat stdout
; Exit
1; }
81 $EGREP ' (-c|-o)' stdout
&& Exit
1
82 $EGREP '(mv|ylwrap) ' stdout
&& Exit
1
84 grep 'LEX .*foo\.' stdout
85 grep 'LEX .*bar\.' stdout
86 grep ' CC .*foo\.' stdout
87 grep ' CC .*bar\.' stdout
88 grep 'CCLD .*foo1' stdout
89 grep 'CCLD .*bar1' stdout
90 grep 'CCLD .*foo2' stdout
91 grep 'CCLD .*bar2' stdout
93 # Cleaning and then rebuilding with the same V flag (and without
94 # removing the generated sources in between) shouldn't trigger a
95 # different set of rules.
98 $MAKE >stdout ||
{ cat stdout
; Exit
1; }
101 $EGREP ' (-c|-o)' stdout
&& Exit
1
102 $EGREP '(mv|ylwrap) ' stdout
&& Exit
1
104 # Don't look for LEX, as probably lex hasn't been re-run.
105 grep ' CC .*foo\.' stdout
106 grep ' CC .*bar\.' stdout
107 grep 'CCLD .*foo1' stdout
108 grep 'CCLD .*bar1' stdout
109 grep 'CCLD .*foo2' stdout
110 grep 'CCLD .*bar2' stdout
112 # Ensure a truly clean rebuild.
114 rm -f foo.c sub
/bar.c
116 $MAKE V
=1 >stdout ||
{ cat stdout
; Exit
1; }
121 grep 'ylwrap ' stdout
123 $EGREP '(LEX|CC|CCLD) ' stdout
&& Exit
1
125 # Cleaning and then rebuilding with the same V flag (and without
126 # removing the generated sources in between) shouldn't trigger a
127 # different set of rules.
130 $MAKE V
=1 >stdout ||
{ cat stdout
; Exit
1; }
133 # Don't look for ylwrap, as probably lex hasn't been re-run.
137 $EGREP '(LEX|CC|CCLD) ' stdout
&& Exit
1
139 # Ensure a truly clean reconfiguration/rebuild.
141 $MAKE maintainer-clean
142 rm -f foo.c sub
/bar.c