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

-- 
J.T. Conklin

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

Reply via email to