Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / suffix11.test
blobe841ece54e11bd6e0547e2b4d8aacd1dc5beeca6
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 # Tests that Automake understands multiple suffix rules on the same line.
18 # PR/371 and PR/372: Reported by Duncan Gibson.
19 # We also check for suffixes containing `-'.
21 . ./defs || Exit 1
23 set -e
25 cat >>configure.in <<EOF
26 AC_PROG_CC
27 AC_OUTPUT
28 EOF
30 cat >Makefile.am << 'END'
31 bin_PROGRAMS = foo bar baz
32 foo_SOURCES = foo.x_
33 bar_SOURCES = bar.y-z
34 baz_SOURCES = baz1.x_ baz2.y-z
35 .y-z.c .x_.c:
36 cp $< $@
37 .z_.c .w_.x_ :
38 cp $< $@
41 print:
42 @echo BEGIN: $(foo_OBJECTS) :END
43 @echo BEGIN: $(bar_OBJECTS) :END
44 @echo BEGIN: $(baz_OBJECTS) :END
45 END
47 $ACLOCAL
48 $AUTOCONF
49 # What we do is not portable. Automake should warn.
50 AUTOMAKE_fails -a
51 grep 'Inference rules can have only one target before the colon' stderr
52 # But this should work anyway.
53 $AUTOMAKE -a -Wno-portability
54 ./configure
55 env OBJEXT=foo $MAKE -e print >stdout
56 cat stdout
57 grep 'BEGIN: foo.foo :END' stdout
58 grep 'BEGIN: bar.foo :END' stdout
59 grep 'BEGIN: baz1.foo baz2.foo :END' stdout