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
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to