1999-09-14 02:03:19 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "Test various flavors of make variable setting.";
|
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 0: Recursive
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
run_make_test('
|
|
|
|
ugh = Goodbye
|
1999-09-14 02:03:19 +00:00
|
|
|
foo = $(bar)
|
|
|
|
bar = ${ugh}
|
|
|
|
ugh = Hello
|
2009-06-04 06:30:27 +00:00
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Hello\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 1: Simple
|
2004-09-21 05:39:04 +00:00
|
|
|
|
|
|
|
run_make_test('
|
2009-06-04 06:30:27 +00:00
|
|
|
bar = Goodbye
|
|
|
|
foo := $(bar)
|
|
|
|
bar = ${ugh}
|
|
|
|
ugh = Hello
|
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Goodbye\n");
|
2004-09-21 05:39:04 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 2: Append to recursive
|
2004-09-21 05:39:04 +00:00
|
|
|
|
|
|
|
run_make_test('
|
2009-06-04 06:30:27 +00:00
|
|
|
foo = Hello
|
|
|
|
ugh = Goodbye
|
|
|
|
foo += $(bar)
|
|
|
|
bar = ${ugh}
|
|
|
|
ugh = Hello
|
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Hello Hello\n");
|
2004-09-21 05:39:04 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 3: Append to simple
|
2004-09-21 05:39:04 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
run_make_test('
|
|
|
|
foo := Hello
|
|
|
|
ugh = Goodbye
|
|
|
|
bar = ${ugh}
|
|
|
|
foo += $(bar)
|
|
|
|
ugh = Hello
|
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Hello Goodbye\n");
|
2004-09-21 05:39:04 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 4: Conditional pre-set
|
2004-09-21 05:39:04 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
run_make_test('
|
|
|
|
foo = Hello
|
|
|
|
ugh = Goodbye
|
|
|
|
bar = ${ugh}
|
|
|
|
foo ?= $(bar)
|
|
|
|
ugh = Hello
|
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Hello\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
2009-06-04 06:30:27 +00:00
|
|
|
# TEST 5: Conditional unset
|
2004-11-29 01:35:13 +00:00
|
|
|
|
|
|
|
run_make_test('
|
2009-06-04 06:30:27 +00:00
|
|
|
ugh = Goodbye
|
|
|
|
bar = ${ugh}
|
|
|
|
foo ?= $(bar)
|
|
|
|
ugh = Hello
|
|
|
|
all: ; @echo $(foo)
|
|
|
|
',
|
|
|
|
'', "Hello\n");
|
2004-11-29 01:35:13 +00:00
|
|
|
|
1999-09-14 02:03:19 +00:00
|
|
|
1;
|