help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Associative arrays and $(eval)


From: Andre Majorel
Subject: Associative arrays and $(eval)
Date: Tue, 3 Feb 2004 16:58:11 +0100
User-agent: Mutt/1.5.4i

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.

-- 
André Majorel <address@hidden>
http://www.teaser.fr/~amajorel/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]