Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / vars3.test
blob4eb2e6493e8be8d08de250687a20ab640ef8c4b2
1 #! /bin/sh
2 # Copyright (C) 2002 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 that Automake warns about variables containing spaces
18 # and other non-POSIX characters.
20 . ./defs || Exit 1
22 set -e
24 cat >Makefile.am <<'EOF'
25 L01 = $(shell echo *)
26 L02 = $$(not an error)
27 L03 = $$(this is)$${ok too}
28 L04 = $(nextvariableisbad)$(addsuffix .a, $(A))
29 L05 = "$(bad boy)"
30 L06 = $(this:is= ok)
31 L07 = ${three errors}${on this} $(long line)
32 L08$(o u c h): $(wildcard *.c)
33 ${another error}
34 echo $${ok-this is}
35 L11: $(thisis) $(ok)
36 ${here}
37 EOF
39 $ACLOCAL
40 # Make sure this warning is print in the `portability' category.
41 $AUTOMAKE --warnings=no-error,none,portability 2>stderr
42 cat stderr
44 # Lines number are printed in error message.
45 # Use them to make sure errors are diagnosed against the right lines.
47 # No error expected for these lines.
48 grep 1: stderr
49 grep 2: stderr && Exit 1
50 grep 3: stderr && Exit 1
51 grep 4: stderr
52 grep 5: stderr
53 grep 6: stderr && Exit 1
54 grep 7: stderr
55 grep 8: stderr
56 grep 9: stderr
57 grep 10: stderr && Exit 1
58 grep 11: stderr && Exit 1
59 grep 12: stderr && Exit 1
61 # Now check some individual values.
62 grep 'shell echo' stderr
63 grep 'nextvariableisbad' stderr && Exit 1
64 grep 'addsuffix' stderr
65 grep 'bad boy' stderr
66 grep 'ok' stderr && Exit 1
67 grep 'three errors' stderr
68 grep 'on this' stderr
69 grep 'long line' stderr
70 grep 'o u c h' stderr
71 grep 'wildcard' stderr
72 grep 'another error' stderr
73 grep 'thisis' stderr && Exit 1
74 grep 'here' stderr && Exit 1
76 # None of these errors be diagnosed with -Wno-portability
77 $AUTOMAKE -Wno-portability
79 # Likewise if we add this in the Makefile.am
80 # (although this makes some difference internally: AUTOMAKE_OPTIONS is
81 # processed far later).
82 echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
83 $AUTOMAKE