2 # Copyright (C) 2002-2024 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 <https://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 AM_LFLAGS
= --never-interactive
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
(const 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.
81 is_newest ..
/foo
/parse.y foo
/parse.h
83 sed 's/%%/%token TOKEN\n%%/g' ..
/foo
/parse.y
>..
/foo
/parse.yt
84 mv -f ..
/foo
/parse.yt ..
/foo
/parse.y
86 is_newest foo
/parse.h ..
/foo
/parse.y
88 # Now, adds another parser to test ylwrap.
92 # Sleep some to make sure timestamp of Makefile.am will change.
95 cp foo
/parse.y foo
/parse2.y
96 cat >> Makefile.am
<< 'END'
97 EXTRA_foo_foo_SOURCES
= foo
/parse2.y
104 # Regenerate Makefile (automatic in GNU Make, but not in other Makes).