2 # Copyright (C) 2002, 2003, 2010, 2011 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)
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
21 required='cc libtoolize'
26 cat >>configure.in <<'END'
32 cat >Makefile.am << 'END'
33 # $(LINK) is not defined automatically by Automake, since the *_SOURCES
34 # variables don't contain any known extension (.c, .cc, .f ...),
35 # So we need this hack.
39 lib_LTLIBRARIES = libfoo.la
42 libfoo_la_SOURCES = bar.x_
44 # The elaborate cp commands below account for VPATH issues on
45 # weaker make implementations (e.g. IRIX 6.5).
47 cp `test -f '$<' || echo $(srcdir)/`$< $@
49 cp `test -f '$<' || echo $(srcdir)/`$< $@
51 cp `test -f '$<' || echo $(srcdir)/`$< $@
53 cp `test -f '$<' || echo $(srcdir)/`$< $@
55 # Some make implementations don't remove intermediate files
56 # automatically, thus causing "make distcheck" to fail if
58 MOSTLYCLEANFILES = *.y_ *.z_
60 .PHONY: test0 test1 test2
62 echo $(foo_OBJECTS) | grep '^foo\.foo$$'
63 echo $(libfoo_la_OBJECTS) | grep '^bar\.lo$$'
65 echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT)$$'
66 echo $(libfoo_la_OBJECTS) | grep '^bar\.lo$$'
67 test2: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
70 check-local: test1 test2
73 echo 'int main (void) { return 0; }' > foo.x_
74 echo 'int bar (void) { return 0; }' > bar.x_
76 command_ok_ "libtoolize" libtoolize
77 command_ok_ "aclocal" $ACLOCAL
78 command_ok_ "autoconf" $AUTOCONF
79 command_ok_ "automake" $AUTOMAKE -a
80 command_ok_ "configure" ./configure
81 command_ok_ "make test0" env OBJEXT=foo $MAKE -e test0
82 command_ok_ "make test1" $MAKE test1
84 directive=''; make_can_chain_suffix_rules || directive=TODO
86 for target in test2 all distcheck; do
87 command_ok_ "make $target" \
88 -D "$directive" -r "suffix rules not chained" \