0b567e8f8f190eddb4d0dba77519c597de9599c5
[platform/upstream/make.git] / tests / scripts / variables / MAKEFLAGS
1 #                                                                    -*-perl-*-
2
3 $description = "Test proper behavior of MAKEFLAGS";
4
5 $details = "DETAILS";
6
7 # Normal flags aren't prefixed with "-"
8 run_make_test(q!
9 all: ; @echo $(MAKEFLAGS)
10 !,
11               '-e -r -R', 'Rre');
12
13 # Long arguments mean everything is prefixed with "-"
14 run_make_test(q!
15 all: ; @echo $(MAKEFLAGS)
16 !,
17               '--no-print-directory -e -r -R', '--no-print-directory -Rre');
18
19
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
35 !,
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');
41 }
42
43 1;