[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using foreach to define variables
From: |
J.T. Conklin |
Subject: |
Re: Using foreach to define variables |
Date: |
Fri, 02 Jul 2010 19:40:23 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) |
Shaun Jackman <address@hidden> 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