Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / suffix8.test
blobce7d3f9d880bff6e3db455cf88150fb82b812d39
1 #! /bin/sh
2 # Copyright (C) 2002, 2003 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 3, 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 <http://www.gnu.org/licenses/>.
17 # Test to make sure Automake supports multiple derivations for the same suffix.
18 # PR/37
20 required='gcc libtoolize'
21 . ./defs || Exit 1
23 set -e
25 cat >>configure.in <<'END'
26 AM_PROG_LIBTOOL
27 AC_OUTPUT
28 END
30 cat >Makefile.am << 'END'
31 bin_PROGRAMS = foo
32 lib_LTLIBRARIES = libfoo.la
34 foo_SOURCES = foo.x_
35 libfoo_la_SOURCES = bar.x_
37 .x_.y_:
38 cp $< $@
40 .y_.o:
41 cp $< $@
43 .y_.z_:
44 cp $< $@
46 .z_.lo:
47 cp $< $@
49 # Add explicit dependencies to help make implementations that
50 # don't otherwise chain implicit rules (e.g., Sun make).
51 foo.$(OBJEXT): foo.y_
52 bar.lo: bar.z_
53 bar.z_: bar.y_
55 print:
56 @echo BEGIN: $(foo_OBJECTS) :END
57 @echo BEGIN: $(libfoo_la_OBJECTS) :END
59 test: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
60 test -f foo.$(OBJEXT)
61 test -f bar.lo
62 END
64 echo 'int main() { return 0; }' > foo.x_
65 cp foo.x_ bar.x_
67 libtoolize
68 $ACLOCAL
69 $AUTOCONF
70 $AUTOMAKE -a
71 ./configure
72 env OBJEXT=foo $MAKE -e print >stdout
73 cat stdout
74 grep 'BEGIN: foo.foo :END' stdout
75 grep 'BEGIN: bar.lo :END' stdout
76 $MAKE test