doc: update Vala documentation
[automake.git] / t / suffix6c.sh
blobb3f20c74f25731bd01558411757ab5d84c986ee9
1 #! /bin/sh
2 # Copyright (C) 2001-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 # Test to make sure that '.o' and '.obj' are handled like '.$(OBJEXT)'.
18 # See also related "grepping" test 'suffix6.sh'.
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 # $(LINK) is not defined automatically by Automake, since the *_SOURCES
24 # variables don't contain any known extension (.c, .cc, .f ...),
25 # So we need this hack -- but since such an hack can also serve as a
26 # mild stress test, that's ok.
27 OBJEXT=${OBJEXT-oOo}
28 AC_SUBST([LINK], ['cat >$@'])
29 AC_SUBST([EXEEXT], [.XxX])
30 AC_SUBST([OBJEXT])
31 AC_OUTPUT
32 END
34 unset OBJEXT
36 cat > Makefile.am << 'END'
37 SUFFIXES = .zoo .o .obj .@OBJEXT@
39 bin_PROGRAMS = foo
40 foo_SOURCES = foo.zoo
42 .zoo.o:
43 { echo '=.zoo.o=' && cat $<; } >$@
44 .zoo.obj:
45 { echo '=.zoo.obj=' && cat $<; } >$@
46 .zoo.@OBJEXT@:
47 { echo '=.zoo.@OBJEXT@=' && cat $<; } >$@
48 END
50 $ACLOCAL
51 $AUTOCONF
52 $AUTOMAKE
54 ./configure
56 cat > foo.exp <<'END'
57 =.zoo.oOo=
58 %ONE%
59 END
60 echo %ONE% > foo.zoo
61 $MAKE
62 cat foo.oOo
63 cat foo.XxX
64 diff foo.XxX foo.exp
66 rm -f foo.* exp
68 cat > foo.exp <<'END'
69 =.zoo.o=
70 %TWO%
71 END
72 echo %TWO% > foo.zoo
73 run_make OBJEXT=o
74 cat foo.o
75 cat foo.XxX
76 diff foo.XxX foo.exp
78 rm -f foo.* exp
80 cat > foo.exp <<'END'
81 =.zoo.obj=
82 %THREE%
83 END
84 echo %THREE% > foo.zoo
85 run_make OBJEXT=obj
86 cat foo.obj
87 cat foo.XxX
88 diff foo.XxX foo.exp
90 rm -f foo.* exp