List Info

Thread: How to generate rules from two lists ?




How to generate rules from two lists ?
country flaguser name
France
2008-03-26 10:58:13
Hi all,

I would like to generate rules from two lists. Currently, I
use only one 
list, then I call repetitively a "generating"
variable, like in the 
following example:

    deps = gcc binutils newlib

    generate = $(1): $(addprefix $(1)-, $(deps))

    $(call generate, configure)
    $(call generate, all)
    $(call generate, install)

I would like to automatize this process, so I tried this
kind of code:

    targets = configure all install
    deps    = gcc binutils newlib

    generate = $(1): $(addprefix $(1)-, $(deps))

    $(foreach target, $(targets), $(call generate,
$(target)))

However, the last line is not expanded as I expected (error
"multiple 
target patterns").

I *do* understand why (all rules are generated on a single
line), but is 
there a way to do what I want? (not especially with the
function foreach)


Thanks,

Christophe.


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )