source: trunk/essentials/sys-devel/automake-1.7/tests/yaccvpath.test

Last change on this file was 3120, checked in by bird, 18 years ago

automake 1.7.9

File size: 2.4 KB
Line 
1#! /bin/sh
2# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
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.
10#
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.
15#
16# You should have received a copy of the GNU General Public License
17# along with autoconf; 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.
20
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.
26
27required='gcc bison'
28. ./defs || exit 1
29
30cat > configure.in << 'END'
31AC_INIT
32AC_CONFIG_AUX_DIR([.])
33AM_INIT_AUTOMAKE(foo, 0.1)
34PACKAGE=foo
35VERSION=0.1
36AC_PROG_CC
37AC_PROG_YACC
38AC_OUTPUT(Makefile)
39END
40
41cat > Makefile.am << 'END'
42bin_PROGRAMS = foo
43foo_SOURCES = parse.y foo.c
44END
45
46# Original parser, with `foobar'
47cat > parse.y << 'END'
48%{
49int yylex () {return 0;}
50void yyerror (char *s) {}
51%}
52%%
53foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
54END
55
56cat > foo.c << 'END'
57int main () { return 0; }
58END
59
60set -e
61
62$ACLOCAL
63$AUTOCONF
64$AUTOMAKE -a
65
66$YACC parse.y
67mv y.tab.c parse.c
68
69mkdir sub
70cd sub
71../configure
72
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
76
77# New parser, with `fubar'
78cat > ../parse.y << 'END'
79%{
80int yylex () {return 0;}
81void yyerror (char *s) {}
82%}
83%%
84fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
85END
86
87$MAKE
88$MAKE distdir
89grep fubar foo-0.1/parse.c
90
91#
92# Now check to make sure that `make dist' will rebuild the parser.
93#
94
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
98
99# New parser, with `maude'
100cat > ../parse.y << 'END'
101%{
102int yylex () {return 0;}
103void yyerror (char *s) {}
104%}
105%%
106maude : 'm' 'a' 'u' 'd' 'e' {};
107END
108
109$MAKE distdir
110grep maude foo-0.1/parse.c
Note: See TracBrowser for help on using the repository browser.