VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/variables/special@ 3208

最後變更 在這個檔案從3208是 3138,由 bird 提交於 7 年 前

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 2.5 KB
 
1# -*-perl-*-
2
3$description = "Test special GNU make variables.";
4
5$details = "";
6
7&run_make_test('
8
9X1 := $(sort $(filter FOO BAR,$(.VARIABLES)))
10
11FOO := foo
12
13X2 := $(sort $(filter FOO BAR,$(.VARIABLES)))
14
15BAR := bar
16
17all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
18',
19 '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n");
20
21# SV 45728: Test that undefining a variable is reflected properly
22
23&run_make_test('
24FOO := foo
25BAR := bar
26$(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
27undefine BAR
28BAZ := baz
29$(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
30all:;@:
31',
32 '', "one: BAR FOO\ntwo: BAZ FOO\n");
33
34# $makefile2 = &get_tmpfile;
35# open(MAKEFILE, "> $makefile2");
36
37# print MAKEFILE <<'EOF';
38
39# X1 := $(sort $(.TARGETS))
40
41# all: foo
42# @echo X1 = $(X1)
43# @echo X2 = $(X2)
44# @echo LAST = $(sort $(.TARGETS))
45
46# X2 := $(sort $(.TARGETS))
47
48# foo:
49
50# EOF
51
52# close(MAKEFILE);
53
54# # TEST #2
55# # -------
56
57# &run_make_with_options($makefile2, "", &get_logfile);
58# $answer = "X1 =\nX2 = all\nLAST = all foo\n";
59# &compare_output($answer, &get_logfile(1));
60
61# Test the .RECIPEPREFIX variable
62&run_make_test('
63define foo
64: foo-one\
65foo-two
66: foo-three
67 : foo-four
68endef
69
70orig: ; : orig-one
71 : orig-two \
72orig-three \
73 orig-four \
74 orig-five \\\\
75 : orig-six
76 $(foo)
77
78.RECIPEPREFIX = >
79test: ; : test-one
80>: test-two \
81test-three \
82>test-four \
83> test-five \\\\
84>: test-six
85>$(foo)
86
87.RECIPEPREFIX =
88reset: ; : reset-one
89 : reset-two \
90reset-three \
91 reset-four \
92 reset-five \\\\
93 : reset-six
94 $(foo)
95',
96 'orig test reset',
97 ': orig-one
98: orig-two \
99orig-three \
100orig-four \
101 orig-five \\\\
102: orig-six
103: foo-one foo-two
104: foo-three
105: foo-four
106: test-one
107: test-two \
108test-three \
109test-four \
110 test-five \\\\
111: test-six
112: foo-one foo-two
113: foo-three
114: foo-four
115: reset-one
116: reset-two \
117reset-three \
118reset-four \
119 reset-five \\\\
120: reset-six
121: foo-one foo-two
122: foo-three
123: foo-four');
124
125# Test that the "did you mean TAB" message is printed properly
126
127run_make_test(q!
128$x.
129!,
130 '', '#MAKEFILE#:2: *** missing separator. Stop.', 512);
131
132run_make_test(q!
133foo:
134 bar
135!,
136 '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512);
137
138run_make_test(q!
139.RECIPEPREFIX = :
140foo:
141 bar
142!,
143 '', '#MAKEFILE#:4: *** missing separator. Stop.', 512);
144
1451;
146
147### Local Variables:
148### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
149### End:
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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