Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / pr204.test
blob19a0ef657b0903ad4c6e39d8d0b8868ac85a069f
1 #! /bin/sh
2 # Copyright (C) 2002, 2004 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 3, or (at your option)
7 # any later version.
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 # For PR 204.
18 # Sources derived from nodist_ sources should not be distributed.
20 required='bison gcc'
21 . ./defs || Exit 1
23 set -e
25 cat > configure.in <<'EOF'
26 AC_INIT(pr204, 0.1)
27 AM_INIT_AUTOMAKE
28 AM_MAINTAINER_MODE
29 AC_PROG_CC
30 AC_PROG_YACC
31 AC_CONFIG_FILES(Makefile)
32 AC_OUTPUT
33 EOF
35 # The PARSE2 intermediate variable is there to make
36 # sure Automake match 'nodist_' against the right
37 # variable name...
38 cat > Makefile.am << 'EOF'
39 AM_YFLAGS = -d
40 EXTRA_PROGRAMS = foo
41 PARSE2 = parse2.y
42 nodist_foo_SOURCES = parse.y $(PARSE2)
44 distdirtest: distdir
45 test ! -f $(distdir)/parse.c
46 test ! -f $(distdir)/parse.y
47 test ! -f $(distdir)/parse.h
48 test ! -f $(distdir)/parse2.c
49 test ! -f $(distdir)/parse2.y
50 test ! -f $(distdir)/parse2.h
51 EOF
53 cat > parse.y << 'END'
55 int yylex () {return 0;}
56 void yyerror (char *s) {}
59 maude : 'm' 'a' 'u' 'd' 'e' {};
60 END
62 cp parse.y parse2.y
64 $ACLOCAL
65 $AUTOCONF
66 $AUTOMAKE -a
67 ./configure
68 $MAKE distdirtest
69 # Make sure parse.c and parse2.c are still targets.
70 $MAKE parse.c parse2.c
71 test -f parse.c
72 test -f parse2.c
74 # Ensure the rebuild rule works despite AM_MAINTAINER_MODE, because
75 # it's a nodist_ parser.
76 $sleep
77 touch parse.y
78 $sleep
79 $MAKE parse.c parse2.c
80 test `ls -1t parse.c parse.y | sed 1q` = parse.c