2 # Copyright (C) 2009-2012 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 # Silent rules: use of pre-defined variables $(AM_V_GEN) and $(AM_V_at).
18 # Incidentally, also check that silent rules are disabled by default.
22 echo AC_OUTPUT >> configure.ac
24 cat > Makefile.am <<'EOF'
27 ## And here's how you should do it in your own code:
29 $(AM_V_GEN)cp $(srcdir)/foo.in $@
30 $(AM_V_at)echo more >> $@
39 $AUTOMAKE --add-missing
42 # Silent rules are disabled by default, since we haven't called
43 # "AM_SILENT_RULES([yes])" explicitly.
45 $MAKE >stdout || { cat stdout; exit 1; }
47 grep 'GEN ' stdout && exit 1
52 $MAKE V=1 >stdout || { cat stdout; exit 1; }
54 grep 'GEN ' stdout && exit 1
59 $MAKE V=0 >stdout || { cat stdout; exit 1; }
61 grep 'GEN .*foo' stdout
62 grep 'cp ' stdout && exit 1
63 grep 'echo ' stdout && exit 1
67 ./configure --enable-silent-rules
68 $MAKE >stdout || { cat stdout; exit 1; }
70 grep 'GEN .*foo' stdout
71 grep 'cp ' stdout && exit 1
72 grep 'echo ' stdout && exit 1
75 $MAKE V=0 >stdout || { cat stdout; exit 1; }
77 grep 'GEN .*foo' stdout
78 grep 'cp ' stdout && exit 1
79 grep 'echo ' stdout && exit 1
82 $MAKE V=1 >stdout || { cat stdout; exit 1; }
84 grep 'GEN ' stdout && exit 1