2 # Copyright (C) 2010-2013 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 # This test checks that dependent files are updated before including
18 # in the distribution. 'lexer.c' depends on 'lexer.l'. The latter is
19 # updated so that 'lexer.c' should be rebuild. Then we are running
20 # 'make' and 'make distdir' and check whether the version of 'lexer.c'
21 # to be distributed is up to date.
23 # Please keep this in sync with sister test 'yaccvapth.sh'.
28 cat > lexoutroot.in << 'END'
29 LEX_OUTPUT_ROOT='@LEX_OUTPUT_ROOT@'
32 cat >> configure.ac << 'END'
33 AC_CONFIG_FILES([lexoutroot])
39 cat > Makefile.am << 'END'
41 foo_SOURCES = lexer.l foo.c
45 # Original lexer, with a "foobar" comment
46 cat > lexer.l << 'END'
48 #define YY_NO_UNISTD_H 1
62 /* Avoid possible link errors. */
75 # We must run configure early, to find out why $LEX_OUTPUT_ROOT is.
79 test -n "$LEX_OUTPUT_ROOT" # Sanity check.
83 mv "$LEX_OUTPUT_ROOT".c lexer.c
87 # Ensure that lexer.l will be newer than lexer.c.
90 # New lexer, with 'fubar' comment.
91 cat > ../lexer.l << 'END'
93 #define YY_NO_UNISTD_H 1
104 $FGREP '/*fubar*/' $distdir/lexer.c
107 # Now check to make sure that 'make dist' will rebuilt the parser.
110 # Ensure that lexer.l will be newer than lexer.c.
113 # New lexer, with 'maude' comment.
114 cat > ../lexer.l << 'END'
116 #define YY_NO_UNISTD_H 1
126 $FGREP '/*maude*/' $distdir/lexer.c