2 # Copyright (C) 2002, 2003, 2004, 2006, 2010, 2011 Free Software
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test for subdir parsers.
24 cat >> configure.in << 'END'
31 cat > Makefile.am << 'END'
32 AUTOMAKE_OPTIONS = subdir-objects
33 bin_PROGRAMS = foo/foo
34 foo_foo_SOURCES = foo/parse.y
38 obj: foo/parse.$(OBJEXT)
41 test1: foo/parse.$(OBJEXT)
43 test -f foo/parse.$(OBJEXT)
44 test2: foo/parse2.$(OBJEXT)
46 test -f foo/parse2.$(OBJEXT)
51 cat > foo/parse.y << 'END'
53 int yylex () {return 0;}
54 void yyerror (char *s) {}
57 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
70 # Aside of the rest of this test, let's see if we can recover from
77 # Make sure foo/parse.h is not updated, unless when needed.
83 test `ls -1t foo/parse.h z | sed 1q` = z
85 sed 's/%%/%token TOKEN\n%%/g' ../foo/parse.y >../foo/parse.yt
86 mv -f ../foo/parse.yt ../foo/parse.y
88 test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h
90 # Now, adds another parser to test ylwrap.
94 # Sleep some to make sure timestamp of Makefile.am will change.
97 cp foo/parse.y foo/parse2.y
98 cat >> Makefile.am << 'END'
99 EXTRA_foo_foo_SOURCES = foo/parse2.y
106 # Regenerate Makefile (automatic in GNU Make, but not in other Makes).