[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Associative arrays and $(eval)
From: |
Mike Gibson |
Subject: |
Re: Associative arrays and $(eval) |
Date: |
Tue, 3 Feb 2004 09:50:27 -0700 |
User-agent: |
KMail/1.5.1 |
Couldn't you put the tab in the main body? Also you don't really need eval
for what you're trying to do:
target:
cp somefile $(DIR_$(ARCH))
On Tuesday 03 February 2004 08:58 am, Andre Majorel wrote:
> I need something like associative arrays in my makefiles recipes.
> Supposing I have a bunch of vars like
>
> DIR_i386=/somedir
> DIR_sparc64=/someotherdir
>
> In shell, I'd do
>
> target:
> cp somefile `eval echo \\$DIR_$ARCH`
>
> But since $(eval) does not return anything, I can't seem to find a
> way to do the same in GNU make. In particular,
>
> target:
> $(eval<tab>cp somefile $$(DIR_$(ARCH)))
>
> gives me a "missing separator" error as the <tab> is swallowed by
> the parser.
>
> Any help would be appreciated.