2 # Copyright (C) 2011-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 # Checks for .c and .h files derived from non-distributed yacc sources.
18 # The test 'yacc-pr204.sh' does similar check with AM_MAINTAINER_MODE
20 # The tests 'lex-nodist.sh' and 'lex-pr204.sh' does similar checks
21 # for lex-generated .c files.
26 cat >> configure.ac
<< 'END'
29 AC_CONFIG_FILES
([sub
1/Makefile sub
2/Makefile
])
33 cat > Makefile.am
<< 'END'
34 AM_LFLAGS
= --never-interactive
37 .PHONY
: test-build test-dist
46 ls -l $
(distdir
) $
(distdir
)/sub1 $
(distdir
)/sub2
47 test ! -r $
(distdir
)/sub
1/parse.y
48 test ! -r $
(distdir
)/sub
1/parse.c
49 test ! -r $
(distdir
)/sub
1/parse.h
50 test ! -r $
(distdir
)/sub
2/parse.y
51 test ! -r $
(distdir
)/sub
2/parse.c
52 test ! -r $
(distdir
)/sub
2/parse.h
53 check-local
: test-build test-dist
58 cat > sub
1/Makefile.am
<< 'END'
63 && echo "int yylex () { return 0; }" \
64 && echo "void yyerror (const char *s) {}" \
67 && echo "maude : 'm' 'a' 'u' 'd' 'e' {}"; \
69 chmod a-w $@
-t && mv -f $@
-t $@
73 nodist_prog_SOURCES
= parse.y
74 CLEANFILES
= $
(nodist_prog_SOURCES
)
77 cat sub
1/Makefile.am
- > sub
2/Makefile.am
<< 'END'
79 BUILT_SOURCES
= parse.h
82 cat > sub
1/main.c
<< 'END'
83 extern int yyparse
(void
);
90 cat - sub
1/main.c
> sub
2/main.c
<< 'END'