Last change
on this file since 2591 was 2591, checked in by bird, 13 years ago |
kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.
|
-
Property svn:eol-style
set to
LF
|
File size:
873 bytes
|
Line | |
---|
1 | # -*-perl-*-
|
---|
2 |
|
---|
3 | $description = "Test the override directive on variable assignments.";
|
---|
4 |
|
---|
5 | $details = "";
|
---|
6 |
|
---|
7 | # TEST 0: Basic override
|
---|
8 |
|
---|
9 | run_make_test('
|
---|
10 | X = start
|
---|
11 | override recur = $(X)
|
---|
12 | override simple := $(X)
|
---|
13 | X = end
|
---|
14 | all: ; @echo "$(recur) $(simple)"
|
---|
15 | ',
|
---|
16 | 'recur=I simple=J', "end start\n");
|
---|
17 |
|
---|
18 | # TEST 1: Override with append
|
---|
19 |
|
---|
20 | run_make_test('
|
---|
21 | X += X1
|
---|
22 | override X += X2
|
---|
23 | override Y += Y1
|
---|
24 | Y += Y2
|
---|
25 | all: ; @echo "$(X) $(Y)"
|
---|
26 | ',
|
---|
27 | '', "X1 X2 Y1\n");
|
---|
28 |
|
---|
29 | # TEST 2: Override with append to the command line
|
---|
30 |
|
---|
31 | run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
|
---|
32 |
|
---|
33 | # Test override of define/endef
|
---|
34 |
|
---|
35 | run_make_test('
|
---|
36 | override define foo
|
---|
37 | @echo First comes the definition.
|
---|
38 | @echo Then comes the override.
|
---|
39 | endef
|
---|
40 | all: ; $(foo)
|
---|
41 | ',
|
---|
42 | 'foo=Hello', "First comes the definition.\nThen comes the override.\n");
|
---|
43 |
|
---|
44 |
|
---|
45 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.