- Enhance .POSIX to set -e when invoking shells, as demanded by a
[make.git] / tests / scripts / variables / MAKEFLAGS
blob0b567e8f8f190eddb4d0dba77519c597de9599c5
1 #                                                                    -*-perl-*-
3 $description = "Test proper behavior of MAKEFLAGS";
5 $details = "DETAILS";
7 # Normal flags aren't prefixed with "-"
8 run_make_test(q!
9 all: ; @echo $(MAKEFLAGS)
11               '-e -r -R', 'Rre');
13 # Long arguments mean everything is prefixed with "-"
14 run_make_test(q!
15 all: ; @echo $(MAKEFLAGS)
17               '--no-print-directory -e -r -R', '--no-print-directory -Rre');
20 if ($all_tests) {
21     # Recursive invocations of make should accumulate MAKEFLAGS values.
22     # Savannah bug #2216
23     run_make_test(q!
24 MSG = Fails
25 all:
26         @echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
27         @MSG=Works $(MAKE) -e -f #MAKEFILE# jump
28 jump:
29         @echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
30         @$(MAKE) -f #MAKEFILE# print
31 print:
32         @echo '$@: MAKEFLAGS=$(MAKEFLAGS)'
33         @echo $(MSG)
34 .PHONY: all jump print
36                   '--no-print-directory',
37                   'all: MAKEFLAGS= --no-print-directory
38 jump: MAKEFLAGS= --no-print-directory -e
39 print: MAKEFLAGS= --no-print-directory -e
40 Works');