> 
> Thanks,
> 
> Let me explain my original problem -and may be you'll find a better
> solution for me :-)
> 
> I want to launch a number of make processes in different directories.
> unfortunatlly each one needs a different target to be made.
> I can do it like this:
> 
>       $(MAKE) -C $(dir1)  $(target1)
>       $(MAKE) -C $(dir2)  $(target2)
>       $(MAKE) -C $(dir3)  $(target3)
>       ....
>       ...
>
well you could do something ugly like: 

all: dirlist

top_dir := .

dirlist:
        $(foreach dir_idx,\
                $(subst subdir_,\
                        ,\
                        $(foreach dir,\
                                $(top_dir),\
                                $(wildcard subdir_[0-9]*)\
                        )\
                )\
                ,$(MAKE) -C  subdir_$(dir_idx) target_$(dir_idx);\
        )

# or for fans of clear-text encryption... put it all in one line
#       $(foreach dir_idx,$(subst subdir_,,$(foreach dir,$(top_dir),$(wildcard 
subdir_[0-9]*))),$(MAKE) -C  subdir_$(dir_idx) target_$(dir_idx);)


which assumes that you have directories called subdir_# and want to build 
target target_#, but I would say the above line is a good introduction how
to write very unreadable makefiles - so I don't know if that is such a good 
idea - note also the limitation that it simply assumes that every entry 
with the name subdir_# actually is a directory no check is made if this is
the case.

I guess the better approach will be a shell-call ;)

hofrat

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to