* aclocal.in (check_acinclude): Output `warning:' in front
[automake.git] / tests / yaccvpath.test
blob42cce6bd20c2a53d8d5c15fb43fc54d24ddfed7d
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # This test checks that dependent files are updated before including
22 # in the distribution. `parse.c' depends on `parce.y'. The later is
23 # updated so that `parse.c' should be rebuild. Then we are running
24 # `make' and `make distdir' and check whether the version of `parse.c'
25 # to be distributed is up to date.
27 required='gcc bison'
28 . ./defs || exit 1
30 cat > configure.in << 'END'
31 AC_INIT
32 AC_CONFIG_AUX_DIR([.])
33 AM_INIT_AUTOMAKE(foo, 0.1)
34 PACKAGE=foo
35 VERSION=0.1
36 AC_PROG_CC
37 AC_PROG_YACC
38 AC_OUTPUT(Makefile)
39 END
41 cat > Makefile.am << 'END'
42 bin_PROGRAMS = foo
43 foo_SOURCES = parse.y foo.c
44 END
46 # Original parser, with `foobar'
47 cat > parse.y << 'END'
49 int yylex () {return 0;}
50 void yyerror (char *s) {}
53 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
54 END
56 cat > foo.c << 'END'
57 int main () { return 0; }
58 END
60 set -e
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE -a
66 $YACC parse.y
67 mv y.tab.c parse.c
69 mkdir sub
70 cd sub
71 ../configure
73 # A delay is needed to make sure that the new parse.y is indeed newer
74 # than parse.c, i.e. the they don't have the same timestamp.
75 $sleep
77 # New parser, with `fubar'
78 cat > ../parse.y << 'END'
80 int yylex () {return 0;}
81 void yyerror (char *s) {}
84 fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
85 END
87 $MAKE
88 $MAKE distdir
89 grep fubar foo-0.1/parse.c
92 # Now check to make sure that `make dist' will rebuild the parser.
95 # A delay is needed to make sure that the new parse.y is indeed newer
96 # than parse.c, i.e. the they don't have the same timestamp.
97 $sleep
99 # New parser, with `maude'
100 cat > ../parse.y << 'END'
102 int yylex () {return 0;}
103 void yyerror (char *s) {}
106 maude : 'm' 'a' 'u' 'd' 'e' {};
109 $MAKE distdir
110 grep maude foo-0.1/parse.c