2011-08-29 16:20:19 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
$description = "Test recursive variables";
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
2011-08-29 16:20:19 +00:00
|
|
|
run_make_test('
|
|
|
|
x = variable1
|
|
|
|
variable2 := Hello
|
|
|
|
y = $(subst 1,2,$(x))
|
|
|
|
z = y
|
|
|
|
a := $($($(z)))
|
|
|
|
all:
|
|
|
|
@echo $(a)
|
|
|
|
',
|
|
|
|
'', "Hello\n");
|
|
|
|
|
|
|
|
# This tests resetting the value of a variable while expanding it.
|
|
|
|
# You may only see problems with this if you're using valgrind or
|
|
|
|
# some other memory checker that poisons freed memory.
|
|
|
|
# See Savannah patch #7534
|
|
|
|
|
|
|
|
run_make_test('
|
|
|
|
VARIABLE = $(eval VARIABLE := echo hi)$(VARIABLE)
|
|
|
|
wololo:
|
|
|
|
@$(VARIABLE)
|
|
|
|
',
|
|
|
|
'', "hi\n");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|