2 # Copyright (C) 2010-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 # Test that POSIX variable expansion '$(var:str=rpl)' works when used
18 # with the SOURCES primary.
23 cat >> configure.ac
<< 'END'
28 cat > Makefile.am
<< 'END'
35 # Also try an empty match suffix, to ensure that the ':=' in there is
36 # not confused by the parser with an unportable assignment operator.
37 foo_SOURCES
= main.c $
(FOO
:.cxx
=.c
)
38 dist_foo_SOURCES
= $
(BAR
:__
=.c
)
39 nodist_foo_SOURCES
= $
(BAZ
:=c
)
42 echo 'int $@ (void) { return 0; }' |
sed 's/\.c //' > $@
44 CLEANFILES
+= bar.c
# For FreeBSD make.
47 check-local
: test1 test2
50 test -f $
(srcdir
)/bar.c
54 ## These sources should be distributed ...
55 test -f $
(distdir
)/bar.c
56 test -f $
(distdir
)/foo.c
57 test -f $
(distdir
)/main.c
58 ## ... and this shouldn't.
59 test ! -r $
(distdir
)/baz.c
65 int foo(void), bar(void), baz(void);
66 return foo() + bar() + baz();
70 echo 'int foo(void) { return 0; }' > foo.c