Alexey Neyman <[EMAIL PROTECTED]> writes:
> X = echo
> A = $($(1)) $$(1) $$(2)
>
> B := $(call A,X)
>
> C = echo $(1) $(2)
>
> all:
> @echo '[$(call B,hi,lo)]'
> @echo '[$(call C,hi,lo)]'
It appears that non-recursive variables don't work well with $(call ).
If you look around function.c:func_call() you will see that at the end
func_call() delegates all the work to expand.c:variable_expand_string()
which has the following code around line 312 (cvs head):
char *value = (v->recursive
? recursively_expand (v)
: v->value);
In other words for non-recursive variables variable_expand_string()
just copies the value without expanding it.
Note than changing
B := $(call A,X)
to
B = $(call A,X)
won't work because now if you insert
$(warning $(value B))
you will see "$(call A,X)", not "echo $(1) $(2)".
A fix could be to just make variables temporarily-recursive in the
context of $(call ) and restore the original mode after $(call ) is
completed. Of course, the following will be possible then
a = $$b
b := $(call a)
c := $(call b)
Not that it is not possible with recursive variables now (segfaults
on cvs head):
b = $b
$(warning $(call b))
Paul, any thoughts?
thanks,
-boris
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/help-make