* configure.ac, NEWS: Bump version to 1.10.
[automake.git] / tests / cond3.test
blob926e59db67316fa939e647475a47cecbb04491c8
1 #! /bin/sh
2 # Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
21 # Test sources listed in conditional.
22 # Report from Rob Savoye <rob@cygnus.com>, and Lars J. Aas.
24 . ./defs || exit 1
26 cat > configure.in << 'END'
27 AC_INIT
28 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
29 AC_PROG_CC
30 AM_CONDITIONAL(ONE, true)
31 AM_CONDITIONAL(TWO, false)
32 AM_CONDITIONAL(THREE, maybe)
33 AC_OUTPUT(Makefile)
34 END
36 cat > Makefile.am << 'END'
37 bin_PROGRAMS = targ
39 if ONE
40 SONE = one.c
41 else
42 SONE =
43 endif
45 if TWO
46 STWO = two.c
47 else
48 STWO =
49 endif
51 if THREE
52 STHREE = three.c
53 else
54 STHREE =
55 endif
57 targ_SOURCES = $(SONE) $(STWO) $(STHREE)
58 END
60 $ACLOCAL || exit 1
61 $AUTOMAKE || exit 1
63 # `b top' so that
64 sed -n '
65 /[oO][bB][jJ][eE][cC][tT].* =/ {
66 : loop
67 /\\$/ {
70 b loop
73 }' Makefile.in >produced
75 cat >expected << 'EOF'
76 @ONE_TRUE@am__objects_1 = one.$(OBJEXT)
77 @TWO_TRUE@am__objects_2 = two.$(OBJEXT)
78 @THREE_TRUE@am__objects_3 = three.$(OBJEXT)
79 am_targ_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3)
80 targ_OBJECTS = $(am_targ_OBJECTS)
81 EOF
83 diff expected produced || exit 1