2 # Copyright (C) 2011-2012 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
([sub
1/Makefile sub
2/Makefile
])
33 cat > Makefile.am
<< 'END'
35 .PHONY
: test-build test-dist
44 ls -l $
(distdir
) $
(distdir
)/sub1 $
(distdir
)/sub2
45 test ! -r $
(distdir
)/sub
1/parse.y
46 test ! -r $
(distdir
)/sub
1/parse.c
47 test ! -r $
(distdir
)/sub
1/parse.h
48 test ! -r $
(distdir
)/sub
2/parse.y
49 test ! -r $
(distdir
)/sub
2/parse.c
50 test ! -r $
(distdir
)/sub
2/parse.h
51 check-local
: test-build test-dist
56 cat > sub
1/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 sub
1/Makefile.am
- > sub
2/Makefile.am
<< 'END'
77 BUILT_SOURCES
= parse.h
80 cat > sub
1/main.c
<< 'END'
86 cat - sub
1/main.c
> sub
2/main.c
<< 'END'
99 # But the distribution must work correctly, assuming the user has
100 # the proper tools to process yacc files. Do this check only with
101 # GNU make, to avoid tripping on automake bug#7884.
102 if using_gmake
; then $MAKE distcheck
; fi