Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / location.test
blob4efaa723557eb61d578ab303d2cbb28b734d5918
1 #! /bin/sh
2 # Copyright (C) 2002, 2003 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 # Test for locations in error messages.
19 . ./defs || Exit 1
21 set -e
23 cat >> configure.in << 'END'
24 AM_CONDITIONAL([COND1], [true])
25 AM_CONDITIONAL([COND2], [true])
26 AC_PROG_CC
27 AC_PROG_RANLIB
28 END
30 cat > Makefile.am << 'END'
31 bin_PROGRAMS = libfoo.a
32 if COND2
33 lib_LIBRARIES = libfoo.a
34 endif
35 if COND1
36 bin_PROGRAMS += ctags
37 endif
38 VAR = 1 \
39 2 \
42 VAR = 1 \
43 2 \
45 END
47 $ACLOCAL
48 AUTOMAKE_fails
50 # Smash the useless difference of lib file locations.
51 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
52 cat >expected <<\EOF
53 Makefile.am:12: VAR multiply defined in condition TRUE ...
54 Makefile.am:8: ... `VAR' previously defined here
55 automake: libfoo_a_OBJECTS should not be defined
56 Makefile.am:3: while processing library `libfoo.a'
57 automake: use `libfoo_a_LDADD', not `libfoo_a_LIBADD'
58 Makefile.am:3: while processing library `libfoo.a'
59 library.am: deprecated feature: target `libfoo.a' overrides `libfoo.a$(EXEEXT)'
60 library.am: change your target to read `libfoo.a$(EXEEXT)'
61 Makefile.am:3: while processing library `libfoo.a'
62 program.am: target `libfoo.a$(EXEEXT)' was defined here
63 Makefile.am:1: while processing program `libfoo.a'
64 program.am: redefinition of `libfoo.a$(EXEEXT)'...
65 Makefile.am:1: while processing program `libfoo.a'
66 library.am: ... `libfoo.a' previously defined here
67 Makefile.am:3: while processing library `libfoo.a'
68 tags.am: redefinition of `ctags'...
69 program.am: ... `ctags$(EXEEXT)' previously defined here
70 Makefile.am:6: while processing program `ctags'
71 EOF
73 diff expected observed || Exit 1