2 # Copyright (C) 2002-2017 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'
29 cat > Makefile.am
<< 'END'
30 AUTOMAKE_OPTIONS
= subdir-objects
31 bin_PROGRAMS
= foo
/foo
32 foo_foo_SOURCES
= foo
/parse.y
36 obj
: foo
/parse.$
(OBJEXT
)
39 test1
: foo
/parse.$
(OBJEXT
)
41 test -f foo
/parse.$
(OBJEXT
)
42 test2
: foo
/parse2.$
(OBJEXT
)
44 test -f foo
/parse2.$
(OBJEXT
)
49 cat > foo
/parse.y
<< 'END'
51 int yylex
() { return 0; }
52 void yyerror
(char
*s
) {}
55 foobar
: 'f' 'o' 'o' 'b' 'a' 'r' {};
68 # Aside of the rest of this test, let's see if we can recover from
75 # Make sure foo/parse.h is not updated, unless when needed.
79 is_newest ..
/foo
/parse.y foo
/parse.h
81 sed 's/%%/%token TOKEN\n%%/g' ..
/foo
/parse.y
>..
/foo
/parse.yt
82 mv -f ..
/foo
/parse.yt ..
/foo
/parse.y
84 is_newest foo
/parse.h ..
/foo
/parse.y
86 # Now, adds another parser to test ylwrap.
90 # Sleep some to make sure timestamp of Makefile.am will change.
93 cp foo
/parse.y foo
/parse2.y
94 cat >> Makefile.am
<< 'END'
95 EXTRA_foo_foo_SOURCES
= foo
/parse2.y
102 # Regenerate Makefile (automatic in GNU Make, but not in other Makes).