VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/targets/ONESHELL@ 3140

Last change on this file since 3140 was 3140, checked in by bird, 7 years ago

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

File size: 1.4 KB
Line 
1# -*-perl-*-
2
3$description = "Test the behaviour of the .ONESHELL target.";
4
5$details = "";
6
7# Some shells (*shakes fist at Solaris*) cannot handle multiple flags in
8# separate arguments.
9my $t = `/bin/sh -e -c true 2>/dev/null`;
10my $multi_ok = $? == 0;
11
12# Simple
13
14run_make_test(q!
15.ONESHELL:
16all:
17 a=$$$$
18 [ 0"$$a" -eq "$$$$" ] || echo fail
19!,
20 '', 'a=$$
21[ 0"$a" -eq "$$" ] || echo fail
22');
23
24# Simple but use multi-word SHELLFLAGS
25
26if ($multi_ok) {
27 run_make_test(q!
28.ONESHELL:
29.SHELLFLAGS = -e -c
30all:
31 a=$$$$
32 [ 0"$$a" -eq "$$$$" ] || echo fail
33!,
34 '', 'a=$$
35[ 0"$a" -eq "$$" ] || echo fail
36');
37}
38
39# Again, but this time with inner prefix chars
40
41run_make_test(q!
42.ONESHELL:
43all:
44 a=$$$$
45 @-+ [ 0"$$a" -eq "$$$$" ] || echo fail
46!,
47 '', 'a=$$
48[ 0"$a" -eq "$$" ] || echo fail
49');
50
51# This time with outer prefix chars
52
53run_make_test(q!
54.ONESHELL:
55all:
56 @a=$$$$
57 [ 0"$$a" -eq "$$$$" ] || echo fail
58!,
59 '', '');
60
61
62# This time with outer and inner prefix chars
63
64run_make_test(q!
65.ONESHELL:
66all:
67 @a=$$$$
68 -@ +[ 0"$$a" -eq "$$$$" ] || echo fail
69!,
70 '', '');
71
72
73# Now try using a different interpreter
74
75run_make_test(q!
76.RECIPEPREFIX = >
77.ONESHELL:
78SHELL = #PERL#
79.SHELLFLAGS = -e
80all:
81> @$$a=5
82> +7;
83> @y=qw(a b c);
84>print "a = $$a, y = (@y)\n";
85!,
86 '', "a = 12, y = (a b c)\n");
87
881;
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette