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.
18 # Keep this in sync with sister test `silent-lex-gcc.test'.
25 cat >>configure.in <<'EOF'
29 AC_CONFIG_FILES([sub/Makefile])
33 cat > Makefile.am <<'EOF'
34 # Need generic and non-generic rules.
35 bin_PROGRAMS = foo1 foo2
37 foo2_SOURCES = $(foo1_SOURCES)
38 foo2_CFLAGS = $(AM_CFLAGS)
43 cat > sub/Makefile.am <<'EOF'
44 AUTOMAKE_OPTIONS = subdir-objects
45 # Need generic and non-generic rules.
46 bin_PROGRAMS = bar1 bar2
48 bar2_SOURCES = $(bar1_SOURCES)
49 bar2_CFLAGS = $(AM_CFLAGS)
58 /* Avoid possible link errors. */
59 int yywrap (void) { return 1; }
60 int main (void) { return 0; }
65 $AUTOMAKE --add-missing
68 # Force dependency tracking explicitly, so that slow dependency
69 # extractors are not rejected. Try also with dependency tracking
70 # explicitly disabled.
72 --enable-dependency-tracking --disable-dependency-tracking
74 ./configure $config_args --enable-silent-rules
76 $MAKE >stdout || { cat stdout; Exit 1; }
79 $EGREP ' (-c|-o)' stdout && Exit 1
80 $EGREP '(mv|ylwrap) ' stdout && Exit 1
82 grep 'LEX .*foo\.' stdout
83 grep 'LEX .*bar\.' stdout
84 grep ' CC .*foo\.' stdout
85 grep ' CC .*bar\.' stdout
86 grep 'CCLD .*foo1' stdout
87 grep 'CCLD .*bar1' stdout
88 grep 'CCLD .*foo2' stdout
89 grep 'CCLD .*bar2' stdout
91 # Cleaning and then rebuilding with the same V flag (and without
92 # removing the generated sources in between) shouldn't trigger a
93 # different set of rules.
96 $MAKE >stdout || { cat stdout; Exit 1; }
99 $EGREP ' (-c|-o)' stdout && Exit 1
100 $EGREP '(mv|ylwrap) ' stdout && Exit 1
102 # Don't look for LEX, as probably lex hasn't been re-run.
103 grep ' CC .*foo\.' stdout
104 grep ' CC .*bar\.' stdout
105 grep 'CCLD .*foo1' stdout
106 grep 'CCLD .*bar1' stdout
107 grep 'CCLD .*foo2' stdout
108 grep 'CCLD .*bar2' stdout
110 # Ensure a truly clean rebuild.
112 rm -f foo.c sub/bar.c
114 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
119 grep 'ylwrap ' stdout
121 $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
123 # Cleaning and then rebuilding with the same V flag (and without
124 # removing the generated sources in between) shouldn't trigger a
125 # different set of rules.
128 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
131 # Don't look for ylwrap, as probably lex hasn't been re-run.
135 $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
137 # Ensure a truly clean reconfiguration/rebuild.
139 $MAKE maintainer-clean
140 rm -f foo.c sub/bar.c