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

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

automake 1.7.9

File size: 1.9 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002 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# Test for subdir parsers.
22
23required="gcc bison"
24
25. ./defs || exit 1
26
27set -e
28
29cat >> configure.in << 'END'
30AC_CONFIG_AUX_DIR([.])
31AC_PROG_CC
32AM_PROG_CC_C_O
33AC_PROG_YACC
34AC_OUTPUT
35END
36
37cat > Makefile.am << 'END'
38AUTOMAKE_OPTIONS = subdir-objects
39bin_PROGRAMS = foo/foo
40foo_foo_SOURCES = foo/parse.y
41AM_YFLAGS = -d
42END
43
44mkdir foo
45
46cat > foo/parse.y << 'END'
47%{
48int yylex () {return 0;}
49void yyerror (char *s) {}
50%}
51%%
52foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
53END
54
55$ACLOCAL
56$AUTOCONF
57$AUTOMAKE -a
58
59mkdir sub
60cd sub
61
62../configure
63$MAKE foo/parse.o
64test -f foo/parse.c
65test -f foo/parse.o
66
67# Aside of the rest of this test, let's see if we can recover from
68# parse.h removal
69test -f foo/parse.h
70rm -f foo/parse.h
71$MAKE foo/parse.h
72test -f foo/parse.h
73
74# Now, adds another parser to test ylwrap.
75
76cd ..
77
78# Sleep some to make sure timestamp of Makefile.am will change.
79$sleep
80
81cp foo/parse.y foo/parse2.y
82cat >> Makefile.am << 'END'
83EXTRA_foo_foo_SOURCES = foo/parse2.y
84END
85
86$AUTOMAKE -a
87test -f ./ylwrap || exit 1
88
89cd sub
90# Regenerate Makefile (automatic in GNU Make, but not in other Makes)
91./config.status
92$MAKE foo/parse2.o
93test -f foo/parse2.c
94test -f foo/parse2.o
95
96exit 0
Note: See TracBrowser for help on using the repository browser.