In the manual:
The eval function is very special: it allows you to define new makefile constructors that are not constants; which result from evaluating other variables and functions. The argument to the eval function expands, then the results of this decomposition are parsed as a makefile.
It is important to understand that the eval argument expands twice; first using the eval function, the results of this extension are expanded again when they are parsed as makefile syntax. This means that you may need to provide additional escapes for the "$" characters when using eval.
"extended twice" confuses me.
For example, I create a make file:
define func
tmp = $(OBJPATH)/$(strip $1)
objs += $$(tmp)
$$(tmp) : $2
gcc $$^ -o $$@
endef
all : foo
$(eval $(call func, foo, 1.c))
How will the eval function expand?