2 # Copyright (C) 2002, 2003, 2004, 2006 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 3, 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 for subdir parsers.
25 cat > configure.
in << 'END'
26 AC_INIT
([yacc8
], [1.0])
27 AC_CONFIG_AUX_DIR
([.
])
29 AC_CONFIG_FILES
([Makefile
])
36 cat > Makefile.am
<< 'END'
37 AUTOMAKE_OPTIONS
= subdir-objects
38 bin_PROGRAMS
= foo
/foo
39 foo_foo_SOURCES
= foo
/parse.y
42 obj
: foo
/parse.$
(OBJEXT
)
46 test -f foo
/parse.$
(OBJEXT
)
50 test -f foo
/parse.$
(OBJEXT
)
55 cat > foo
/parse.y
<< 'END'
57 int yylex
() {return 0;}
58 void yyerror
(char
*s
) {}
61 foobar
: 'f' 'o' 'o' 'b' 'a' 'r' {};
74 # Aside of the rest of this test, let's see if we can recover from
81 # Make sure foo/parse.h is not updated, unless when needed.
87 test `ls -1t foo/parse.h z | sed 1q` = z
89 sed 's/%%/%token TOKEN\n%%/g' ..
/foo
/parse.y
>..
/foo
/parse.yt
90 mv -f ..
/foo
/parse.yt ..
/foo
/parse.y
92 test `ls -1t foo/parse.h z | sed 1q` = foo
/parse.h
94 # Now, adds another parser to test ylwrap.
98 # Sleep some to make sure timestamp of Makefile.am will change.
101 cp foo
/parse.y foo
/parse2.y
102 cat >> Makefile.am
<< 'END'
103 EXTRA_foo_foo_SOURCES
= foo
/parse2.y
107 test -f .
/ylwrap || Exit
1
110 # Regenerate Makefile (automatic in GNU Make, but not in other Makes)