2 # Copyright (C) 2002-2012 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 # 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 '-'.
26 cat >>configure.ac <<EOF
31 cat >Makefile.am << 'END'
32 bin_PROGRAMS = foo bar baz
35 baz_SOURCES = baz1.x_ baz2.y-z
38 ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5).
39 sed 's/INTEGER/int/g' `test -f '$<' || echo $(srcdir)/`$< >$@
41 CLEANFILES = foo.c bar.c baz1.c baz2.c
43 .PHONY: test-real test-fake
45 echo $(foo_OBJECTS) | grep '^foo\.foo$$'
46 echo $(bar_OBJECTS) | grep '^bar\.foo$$'
47 echo $(baz_OBJECTS) | grep '^baz1\.foo baz2\.foo$$'
49 echo $(foo_OBJECTS) | grep '^foo\.$(OBJEXT)$$'
50 echo $(bar_OBJECTS) | grep '^bar\.$(OBJEXT)$$'
51 echo $(baz_OBJECTS) | grep '^baz1\.$(OBJEXT) baz2\.$(OBJEXT)$$'
52 check-local: test-real
55 echo 'INTEGER main(void) { return 0; }' > foo.x_
56 echo 'INTEGER main(void) { return 0; }' > bar.y-z
57 echo 'INTEGER main(void) { INTEGER baz(void); return baz(); }' > baz1.x_
58 echo 'INTEGER baz(void) { return 0; }' > baz2.y-z
60 command_ok_ "aclocal" $ACLOCAL
61 command_ok_ "autoconf" $AUTOCONF
63 # What we do is not portable. Automake should warn.
65 command_ok_ "warn about unportable make usage" \
66 grep '[iI]nference rules can have only one target before the colon' stderr
67 # But this should work anyway.
68 command_ok_ "automake" $AUTOMAKE -a -Wno-portability
70 command_ok_ "configure" ./configure
71 command_ok_ "make test-fake" env OBJEXT=foo $MAKE -e test-fake
72 command_ok_ "make test-real" $MAKE test-real
74 directive=''; make_can_chain_suffix_rules || directive=TODO
76 for target in '' distcheck; do
77 command_ok_ "make $target" \
78 -D "$directive" -r "suffix rules not chained" \