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'.
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)
57 /* avoid non-ANSI #include of unistd.h */
58 #define YY_NO_UNISTD_H 1
64 /* Avoid possible link errors. */
65 int yywrap (void) { return 1; }
66 int main (void) { return 0; }
71 $AUTOMAKE --add-missing
74 # Force dependency tracking explicitly, so that slow dependency
75 # extractors are not rejected. Try also with dependency tracking
76 # explicitly disabled.
78 --enable-dependency-tracking --disable-dependency-tracking
80 ./configure $config_args --enable-silent-rules
82 $MAKE >stdout || { cat stdout; Exit 1; }
85 $EGREP ' (-c|-o)' stdout && Exit 1
86 $EGREP '(mv|ylwrap) ' stdout && Exit 1
88 grep 'LEX .*foo\.' stdout
89 grep 'LEX .*bar\.' stdout
90 grep ' CC .*foo\.' stdout
91 grep ' CC .*bar\.' stdout
92 grep 'CCLD .*foo1' stdout
93 grep 'CCLD .*bar1' stdout
94 grep 'CCLD .*foo2' stdout
95 grep 'CCLD .*bar2' stdout
97 # Cleaning and then rebuilding with the same V flag (and without
98 # removing the generated sources in between) shouldn't trigger a
99 # different set of rules.
102 $MAKE >stdout || { cat stdout; Exit 1; }
105 $EGREP ' (-c|-o)' stdout && Exit 1
106 $EGREP '(mv|ylwrap) ' stdout && Exit 1
108 # Don't look for LEX, as probably lex hasn't been re-run.
109 grep ' CC .*foo\.' stdout
110 grep ' CC .*bar\.' stdout
111 grep 'CCLD .*foo1' stdout
112 grep 'CCLD .*bar1' stdout
113 grep 'CCLD .*foo2' stdout
114 grep 'CCLD .*bar2' stdout
116 # Ensure a truly clean rebuild.
118 rm -f foo.c sub/bar.c
120 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
125 grep 'ylwrap ' stdout
127 $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
129 # Cleaning and then rebuilding with the same V flag (and without
130 # removing the generated sources in between) shouldn't trigger a
131 # different set of rules.
134 $MAKE V=1 >stdout || { cat stdout; Exit 1; }
137 # Don't look for ylwrap, as probably lex hasn't been re-run.
141 $EGREP '(LEX|CC|CCLD) ' stdout && Exit 1
143 # Ensure a truly clean reconfiguration/rebuild.
145 $MAKE maintainer-clean
146 rm -f foo.c sub/bar.c