VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/variables/DEFAULT_GOAL

Last change on this file 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).

  • Property svn:eol-style set to LF
File size: 1.2 KB
Line 
1# -*-perl-*-
2$description = "Test the .DEFAULT_GOAL special variable.";
3
4$details = "";
5
6
7# Test #1: basic logic.
8#
9run_make_test('
10# Basics.
11#
12foo: ; @:
13
14ifneq ($(.DEFAULT_GOAL),foo)
15$(error )
16endif
17
18# Reset to empty.
19#
20.DEFAULT_GOAL :=
21
22bar: ; @:
23
24ifneq ($(.DEFAULT_GOAL),bar)
25$(error )
26endif
27
28# Change to a different goal.
29#
30
31.DEFAULT_GOAL := baz
32
33baz: ; @echo $@
34',
35'',
36'baz');
37
38
39# Test #2: unknown goal.
40#
41run_make_test('
42.DEFAULT_GOAL = foo
43',
44'',
45"#MAKE#: *** No rule to make target 'foo'. Stop.",
46512);
47
48
49# Test #3: more than one goal.
50#
51run_make_test('
52.DEFAULT_GOAL := foo bar
53',
54'',
55'#MAKE#: *** .DEFAULT_GOAL contains more than one target. Stop.',
56512);
57
58
59# Test #4: Savannah bug #12226.
60#
61run_make_test('
62define rule
63foo: ; @echo $$@
64endef
65
66define make-rule
67$(eval $(rule))
68endef
69
70$(call make-rule)
71
72',
73'',
74'foo');
75
76# TEST #5: .DEFAULT_GOAL containing just whitespace (Savannah bug #25697)
77
78run_make_test('
79N =
80.DEFAULT_GOAL = $N $N # Just whitespace
81
82foo: ; @echo "boo"
83',
84 '', "#MAKE#: *** No targets. Stop.\n", 512);
85
86# This tells the test driver that the perl test script executed properly.
871;
Note: See TracBrowser for help on using the repository browser.

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