2 # Copyright (C) 2011-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 # 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([sub1/Makefile sub2/Makefile])
33 cat > Makefile.am << 'END'
35 .PHONY: test-build test-dist
44 ls -l $(distdir) $(distdir)/sub1 $(distdir)/sub2
45 test ! -r $(distdir)/sub1/parse.y
46 test ! -r $(distdir)/sub1/parse.c
47 test ! -r $(distdir)/sub1/parse.h
48 test ! -r $(distdir)/sub2/parse.y
49 test ! -r $(distdir)/sub2/parse.c
50 test ! -r $(distdir)/sub2/parse.h
51 check-local: test-build test-dist
56 cat > sub1/Makefile.am << 'END'
61 && echo "int yylex () { return 0; }" \
62 && echo "void yyerror (char *s) {}" \
65 && echo "maude : 'm' 'a' 'u' 'd' 'e' {}"; \
67 chmod a-w $@-t && mv -f $@-t $@
71 nodist_prog_SOURCES = parse.y
72 CLEANFILES = $(nodist_prog_SOURCES)
75 cat sub1/Makefile.am - > sub2/Makefile.am << 'END'
77 BUILT_SOURCES = parse.h
80 cat > sub1/main.c << 'END'
86 cat - sub1/main.c > sub2/main.c << 'END'