Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / suffix11.test
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2010 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 # 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 `-'.
20
21 . ./defs || Exit 1
22
23 set -e
24
25 cat >>configure.in <<EOF
26 AC_PROG_CC
27 AC_OUTPUT
28 EOF
29
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 $< $@
39
40 .PHONY: print
41 print:
42         @echo BEGIN: $(foo_OBJECTS) :END
43         @echo BEGIN: $(bar_OBJECTS) :END
44         @echo BEGIN: $(baz_OBJECTS) :END
45 END
46
47 $ACLOCAL
48 $AUTOCONF
49
50 # What we do is not portable.  Automake should warn.
51 AUTOMAKE_fails -a
52 grep '[iI]nference rules can have only one target before the colon' stderr
53
54 # But this should work anyway.
55 $AUTOMAKE -a -Wno-portability
56
57 ./configure
58
59 OBJEXT=foo $MAKE -e print >stdout || { cat stdout; Exit 1; }
60 cat stdout
61 $FGREP 'BEGIN: foo.foo :END' stdout
62 $FGREP 'BEGIN: bar.foo :END' stdout
63 $FGREP 'BEGIN: baz1.foo baz2.foo :END' stdout
64
65 :