maint: Update HACKING
[automake.git] / t / silent-f90.sh
blob6ace2a5c5d09c1afe1abdeac978119d32d235d51
1 #!/bin/sh
2 # Copyright (C) 2010-2017 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 Fortran 90.
18 # Keep this ins sync with the sister test 'silent-f77.sh'.
20 required=fortran
21 . test-init.sh
23 mkdir sub
25 cat >>configure.ac <<'EOF'
26 AC_PROG_FC
27 AC_CONFIG_FILES([sub/Makefile])
28 AC_OUTPUT
29 EOF
31 cat > Makefile.am <<'EOF'
32 # Need generic and non-generic rules.
33 bin_PROGRAMS = foo1 foo2
34 foo1_SOURCES = foo.f90
35 foo2_SOURCES = $(foo1_SOURCES)
36 foo2_FCFLAGS = $(AM_FCLAGS)
37 SUBDIRS = sub
38 EOF
40 cat > sub/Makefile.am <<'EOF'
41 AUTOMAKE_OPTIONS = subdir-objects
42 # Need generic and non-generic rules.
43 bin_PROGRAMS = bar1 bar2
44 bar1_SOURCES = bar.f90
45 bar2_SOURCES = $(bar1_SOURCES)
46 bar2_FCFLAGS = $(AM_FCLAGS)
47 EOF
49 cat > foo.f90 <<'EOF'
50 program foo
51 stop
52 end
53 EOF
54 cp foo.f90 sub/bar.f90
56 $ACLOCAL
57 $AUTOMAKE --add-missing
58 $AUTOCONF
60 ./configure --enable-silent-rules
61 run_make -O
62 # Avoid spurious failures with SunStudio Fortran compilers.
63 sed '/^NOTICE:/d' stdout > t
64 mv -f t stdout
65 cat stdout
67 $EGREP ' (-c|-o)' stdout && exit 1
68 grep 'mv ' stdout && exit 1
70 grep 'FC .*foo\.' stdout
71 grep 'FC .*bar\.' stdout
72 grep 'FCLD .*foo1' stdout
73 grep 'FCLD .*bar1' stdout
74 grep 'FCLD .*foo2' stdout
75 grep 'FCLD .*bar2' stdout
77 $EGREP '(F77|F77LD) ' stdout && exit 1
79 # Ensure a clean rebuild.
80 $MAKE clean
82 run_make -O V=1
84 grep ' -c ' stdout
85 grep ' -o ' stdout
87 $EGREP '(F77|FC|LD) ' stdout && exit 1