doc: update Vala documentation
[automake.git] / t / silent-c.sh
blob265360aa152044ca98d1c94b9d5290791a777af8
1 #!/bin/sh
2 # Copyright (C) 2009-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check silent-rules mode for C, without libtool, both with and without
18 # automatic dependency tracking.
20 required=cc
21 . test-init.sh
23 mkdir sub
25 cat >>configure.ac <<'EOF'
26 AC_CONFIG_FILES([sub/Makefile])
27 AC_PROG_CC
28 AC_OUTPUT
29 EOF
31 cat > Makefile.am <<'EOF'
32 # Need generic and non-generic rules.
33 bin_PROGRAMS = foo bar
34 bar_CFLAGS = $(AM_CFLAGS)
35 SUBDIRS = sub
36 EOF
38 cat > sub/Makefile.am <<'EOF'
39 AUTOMAKE_OPTIONS = subdir-objects
40 # Need generic and non-generic rules.
41 bin_PROGRAMS = baz bla
42 bla_CFLAGS = $(AM_CFLAGS)
43 EOF
45 cat > foo.c <<'EOF'
46 int main ()
48 return 0;
50 EOF
51 cp foo.c bar.c
52 cp foo.c sub/baz.c
53 cp foo.c sub/bla.c
55 $ACLOCAL
56 $AUTOMAKE --add-missing
57 $AUTOCONF
59 for config_args in \
60 '--enable-dependency-tracking' \
61 '--disable-dependency-tracking' \
62 ; do
64 ./configure --enable-silent-rules $config_args
66 run_make -O
67 $EGREP ' (-c|-o)' stdout && exit 1
68 grep 'mv ' stdout && exit 1
69 grep 'CC .*foo\.' stdout
70 grep 'CC .*bar\.' stdout
71 grep 'CC .*baz\.' stdout
72 grep 'CC .*bla\.' stdout
73 grep 'CCLD .*foo' stdout
74 grep 'CCLD .*bar' stdout
75 grep 'CCLD .*baz' stdout
76 grep 'CCLD .*bla' stdout
78 $MAKE clean
79 run_make -O V=1
80 grep ' -c' stdout
81 grep ' -o foo' stdout
82 $EGREP '(CC|LD) ' stdout && exit 1
84 $MAKE distclean
86 done