Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / cond36.test
blobe5e8f8ba0bb36970fa0db9675d90abab1da8b964
1 #!/bin/sh
2 # Copyright (C) 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 # Check rules output for parser defined conditionally.
19 required='flex bison gcc'
20 . ./defs
22 set -e
24 cat >>configure.in <<'EOF'
25 AM_CONDITIONAL([CASE_A], test -z "$case_B")
26 AC_PROG_CC
27 AM_PROG_LEX
28 AC_PROG_YACC
29 AC_OUTPUT
30 EOF
32 cat >>Makefile.am <<'EOF'
33 AM_YFLAGS = -d
35 BUILT_SOURCES = tparse.h
37 if CASE_A
38 bin_PROGRAMS = ta
39 ta_SOURCES = ta.c tparse.h tscan.l tparse.y
40 ta_LDADD = $(LEXLIB)
41 else
42 bin_PROGRAMS = tb
43 tb_SOURCES = tb.c tparse.h tscan.l tparse.y
44 tb_LDADD = $(LEXLIB)
45 tparse.h: tparce.c
46 echo whatever
47 endif
48 EOF
50 $ACLOCAL
52 # Presently Automake doesn't fully support partially overriden rules
53 # and should complain.
54 AUTOMAKE_fails --add-missing
55 grep 'tparse.h.*already defined' stderr
56 $AUTOMAKE -Wno-error
58 # Still and all, it should generate two rules.
59 test `grep tparse.h: Makefile.in | wc -l` = 2
60 grep '@CASE_A_TRUE@tparse.h:' Makefile.in
61 grep '@CASE_A_FALSE@tparse.h:' Makefile.in