2 # Copyright (C) 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 # Vala sources, C and C++ sources and C and C++ headers in the same
18 # program. Functional test. See automake bug#10894.
20 required='valac cc c++ GNUmake'
23 cat >> configure.ac <<'END'
26 AM_PROG_VALAC([0.7.3])
30 cat > Makefile.am <<'END'
32 AM_VALAFLAGS = --profile=posix
33 zardoz_SOURCES = zardoz.vala foo.h bar.c baz.c zen.hh master.cxx
36 cat > zardoz.vala <<'END'
39 stdout.printf ("foo is alive\n");
52 int bar (void) { return foo + baz (); }
58 int baz (void) { return 0; }
65 cat > master.cxx <<'END'
67 void chatty (void) { std::cout << "Hello, stranger!\n"; }
77 ls -l # For debugging.
79 have_generated_files ()
81 test -f zardoz_vala.stamp
85 # Our vala-related rules must create stamp files and intermediate
89 # Remake rules are not uselessly triggered.
91 $MAKE -n | $FGREP vala.stamp && Exit 1
93 # But are triggered when they should.
94 for file in zardoz.vala foo.h bar.c baz.c zen.hh master.cxx; do
96 echo '& choke me !' >> $file
104 # Check the distribution.
107 # Stamp files and intermediate C files should *not* be removed
110 ls -l # For debugging.
113 # But stamp files should be removed by "maintainer-clean" (the
114 # behaviour w.r.t. intermediate C files is still unclear, and
115 # better left undefined for the moment).
116 $MAKE maintainer-clean
117 ls *vala*.stamp | grep . && Exit 1