2 # Copyright (C) 2002-2012 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 2, 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.
23 cat >> configure.ac
<< 'END'
30 cat > Makefile.am
<< 'END'
31 AUTOMAKE_OPTIONS
= subdir-objects
32 bin_PROGRAMS
= foo
/foo
33 foo_foo_SOURCES
= foo
/parse.y
37 obj
: foo
/parse.$
(OBJEXT
)
40 test1
: foo
/parse.$
(OBJEXT
)
42 test -f foo
/parse.$
(OBJEXT
)
43 test2
: foo
/parse2.$
(OBJEXT
)
45 test -f foo
/parse2.$
(OBJEXT
)
50 cat > foo
/parse.y
<< 'END'
52 int yylex
() { return 0; }
53 void yyerror
(char
*s
) {}
56 foobar
: 'f' 'o' 'o' 'b' 'a' 'r' {};
69 # Aside of the rest of this test, let's see if we can recover from
76 # Make sure foo/parse.h is not updated, unless when needed.
80 is_newest ..
/foo
/parse.y foo
/parse.h
82 sed 's/%%/%token TOKEN\n%%/g' ..
/foo
/parse.y
>..
/foo
/parse.yt
83 mv -f ..
/foo
/parse.yt ..
/foo
/parse.y
85 is_newest foo
/parse.h ..
/foo
/parse.y
87 # Now, adds another parser to test ylwrap.
91 # Sleep some to make sure timestamp of Makefile.am will change.
94 cp foo
/parse.y foo
/parse2.y
95 cat >> Makefile.am
<< 'END'
96 EXTRA_foo_foo_SOURCES
= foo
/parse2.y
103 # Regenerate Makefile (automatic in GNU Make, but not in other Makes).