On Mon, Jun 13, 2011 at 9:54 AM, John Dill <[email protected]>wrote:

> Date: Sat, 11 Jun 2011 01:33:42 +0200
> From: grischka <[email protected]>
> Subject: Re: Named parameters in make?
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> >> Over my time using make I know I've read section 8.8 "The eval Function"
> a
> >> number of times. But the implication of this sentence didn't hit me
> until I
> >> saw your example:
> >>
> >> "The argument to the eval function is expanded, then the results of that
> >> expansion are parsed as makefile syntax."
> >
> >Reason why eval is difficult to understand is that there is no good
> >reason to have it, in the first place.
> >
> >For example one can write:
> >
> >    all_rule = all : ; echo $$@
> >    $(all_rule)
> >
> >which expands the macro $(all_rule) and does parse the result as
> >makefile syntax.  That is everything said in the above statement,
> >just without 'eval'.
>
> The only use I have for using $(eval) directly is setting a variable within
> a user-defined function, which is quite useful in some contexts.
>
> set=$(eval $1:=$2)
>
> I use this behavior of $(eval) quite frequently.
>
John,

I've never seen eval used in this way. Would you mind elaborating on what
the above snippet does?

Thanks,
Lane
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to