[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help-make Digest, Vol 77, Issue 5
From: |
Sam Ravnborg |
Subject: |
Re: Help-make Digest, Vol 77, Issue 5 |
Date: |
Thu, 9 Apr 2009 08:54:08 +0200 |
User-agent: |
Mutt/1.4.2.1i |
On Thu, Apr 09, 2009 at 02:27:43PM +0800, xiangfeng shen wrote:
> Hi,
>
> I have a question about how to replace for loop in clearmake to avoid bad
> DO.
> Makefile:
>
> SUBDIRS = foo bar baz
>
> subdirs:
>
> for dir in $(SUBDIRS); do \
>
> $(MAKE) -C $$dir; \
>
> done
So you want to execute $(MAKE) for each dir.
There are several ways to do so:
1) Using the shell
subdirs:
for D in $(SUBDIRS); do make -C $D; done
2) Using the builtin shell
subdirs:
$(foreach D, $(SUBDIRS), $(shell $(MAKE) -C $D))
3) Using dependencies
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
This is all from memory and un-tested..
Sam
- Re: Help-make Digest, Vol 77, Issue 5, xiangfeng shen, 2009/04/09
- Re: Help-make Digest, Vol 77, Issue 5,
Sam Ravnborg <=
- Re: Help-make Digest, Vol 77, Issue 5, xiangfeng shen, 2009/04/09
- Re: Help-make Digest, Vol 77, Issue 5, Sam Ravnborg, 2009/04/10
- Re: Help-make Digest, Vol 77, Issue 5, xiangfeng shen, 2009/04/10
- Re: Help-make Digest, Vol 77, Issue 5, Paul Smith, 2009/04/10
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Michael R. Head, 2009/04/10
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Philip Guenther, 2009/04/11
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Michael R. Head, 2009/04/11
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Sam Ravnborg, 2009/04/11
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Paul Smith, 2009/04/11
- Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5], Michael R. Head, 2009/04/11