news: describe recently-fixed bug in vala support
[platform/upstream/automake.git] / tests / suffix8.test
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2010, 2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test to make sure Automake supports multiple derivations for the same suffix.
18 # PR/37
19
20 required='gcc libtoolize'
21 . ./defs || Exit 1
22
23 set -e
24
25 cat >>configure.in <<'END'
26 AM_PROG_LIBTOOL
27 AC_OUTPUT
28 END
29
30 cat >Makefile.am << 'END'
31 bin_PROGRAMS = foo
32 lib_LTLIBRARIES = libfoo.la
33
34 foo_SOURCES = foo.x_
35 libfoo_la_SOURCES = bar.x_
36
37 .x_.y_:
38         cp $< $@
39
40 .y_.o:
41         cp $< $@
42
43 .y_.obj:
44         cp $< $@
45
46 .y_.z_:
47         cp $< $@
48
49 .z_.lo:
50         cp $< $@
51
52 # Add explicit dependencies to help make implementations that
53 # don't otherwise chain implicit rules (e.g., Sun make).
54 foo.$(OBJEXT): foo.y_
55 bar.lo: bar.z_
56 bar.z_: bar.y_
57
58 print:
59         @echo BEGIN: $(foo_OBJECTS) :END
60         @echo BEGIN: $(libfoo_la_OBJECTS) :END
61
62 test: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
63         test -f foo.$(OBJEXT)
64         test -f bar.lo
65 END
66
67 echo 'int main() { return 0; }' > foo.x_
68 cp foo.x_ bar.x_
69
70 libtoolize
71 $ACLOCAL
72 $AUTOCONF
73 $AUTOMAKE -a
74
75 ./configure
76
77 OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
78 cat stdout
79 $FGREP 'BEGIN: foo.foo :END' stdout
80 $FGREP 'BEGIN: bar.lo :END' stdout
81
82 $MAKE test
83
84 :