help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Named parameters in make?


From: Lane Schwartz
Subject: Re: Named parameters in make?
Date: Mon, 13 Jun 2011 09:58:33 -0400

On Mon, Jun 13, 2011 at 9:54 AM, John Dill <address@hidden>wrote:

> Date: Sat, 11 Jun 2011 01:33:42 +0200
> From: grischka <address@hidden>
> Subject: Re: Named parameters in make?
> Message-ID: <address@hidden>
> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]