2 # Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # Test for subdir parsers.
29 cat > configure.in << 'END'
30 AC_INIT([yacc8], [1.0])
31 AC_CONFIG_AUX_DIR([.])
33 AC_CONFIG_FILES([Makefile])
40 cat > Makefile.am << 'END'
41 AUTOMAKE_OPTIONS = subdir-objects
42 bin_PROGRAMS = foo/foo
43 foo_foo_SOURCES = foo/parse.y
46 obj: foo/parse.$(OBJEXT)
50 test -f foo/parse.$(OBJEXT)
54 test -f foo/parse.$(OBJEXT)
59 cat > foo/parse.y << 'END'
61 int yylex () {return 0;}
62 void yyerror (char *s) {}
65 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
78 # Aside of the rest of this test, let's see if we can recover from
85 # Make sure foo/parse.h is not updated, unless when needed.
91 test `ls -1t foo/parse.h z | sed 1q` = z
93 $PERL -pi -e 's/%%/%token TOKEN\n%%/g' ../foo/parse.y
95 test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h
97 # Now, adds another parser to test ylwrap.
101 # Sleep some to make sure timestamp of Makefile.am will change.
104 cp foo/parse.y foo/parse2.y
105 cat >> Makefile.am << 'END'
106 EXTRA_foo_foo_SOURCES = foo/parse2.y
110 test -f ./ylwrap || exit 1
113 # Regenerate Makefile (automatic in GNU Make, but not in other Makes)