[Top][All Lists]

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

loop to create variables, foreach?

From: Anton Deguet
Subject: loop to create variables, foreach?
Date: Tue, 31 Jul 2001 16:36:00 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010628


I want to build multiple lists of files based on the same string substitution using some kind of loop. I tried something with foreach, that is:

libs = lib1 lib2

lib1_cfiles_prefix = file1 file2 file3
lib2_cfiles_prefix = fichier1 fichier2 fichier3

now I want to build some object lists called lib1_obj, lib2_obj, etc... which would contain:

lib1_obj = my_bin_dir/file1.o my_bin_dir/file2.o my_bin_dir/file3.o
lib2_obj = my_bin_dir/fichier1.o my_bin_dir/fichier2.o  ...

So I tried this:
FOO:= $(foreach lib, $libs, $(lib)_obj=$($(lib)_cfiles_prefix:%=my_bin_dir/%.o))

In FOO, I got something pretty close if I do "echo $(FOO)" but it's a string, not a set of variables. Can I force some kind of evaluation to set the variable during the iteration of the foreach?

Any other solution/suggestion is welcome.

Thanks in advance.


-- Computer Integrated Surgery Systems Technology --
------------- Johns Hopkins University -------------
-- Anton Deguet ---------------- address@hidden --
-- Office NEB 26 ------------------- 410 516 5261 --

reply via email to

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