On Fri, 2010-07-02 at 19:40 -0700, J.T. Conklin wrote:
> Shaun Jackman <[email protected]> writes:
> > I'd like to use foreach to define variables like so:
> >
> > ==> Makefile <==
> > $(foreach i,a b c,$i=1)
> > all:
> >     echo $a $b $c
> >
> > But I receive this error:
> > $ make
> > Makefile:1: *** missing separator.  Stop.
> >
> > Can this be made to work?
> 
> Use $(eval ...), like:
> 
>     $(foreach i,a b c,$(eval $i = 1))
>     all:
>         echo $a $b $c
> 
> Hope this helps,
> 
>     --jtc

Worked like a charm. Thanks!


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to