> Hi,
>
> I have two lists with same number of items in each one.
>
> DIRS is a list of directories
> TARGETS is a list of targets
>
> I want to do something like:
>
> foreach num from 1 to MAX_NUM
> $(MAKE) -C $(DIR)[$num] $(TARGET)[$num]
>
>
> Is there a way to do it in make, or should I use shell instead ?
>
you could use the foreach function but you would have to pack the "1 to MAX_NUM"
into a variable that you have to generate with a shell call as there is no
for loop available in the way you are suggesting it.
Alternatively if you simply want to handle the rule for every numeric subdir
in a specific directory then you can use make builtin functions.
something like
---Makefile.dirlist---
all: dirlist
top_dir := .
DIRS := $(foreach dir,$(top_dir),$(wildcard $(dir)/[0-9]*))
dirlist:
@echo $(DIRS)
should be able to fill in the DIRS variable with all existing numeric
directory names in $(top_dir). The targets can then be generated the
same way.
hofrat
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make