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`

Doesn't make evaluate it properly, without 'eval'?

# Makefile begins #
DIR_i386=/somedir
DIR_sparc64=/someotherdir

.PHONY: all
all:
        @echo 'DIR_$$(ARCH)'=DIR_$(ARCH)
        @echo '$$(DIR_$$(ARCH))'=$(DIR_$(ARCH))
        cd $(DIR_$(ARCH))
# Makefile ends #

C:/tmp[0]$make -f Makefile
DIR_$(ARCH)=DIR_i386
$(DIR_$(ARCH))=/somedir
cd /somedir



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to