On 19-Sep-2000, Sankaranarayanan K V <[EMAIL PROTECTED]> wrote:
> SUBDIRS = ok-dir-1 bad-dir ok-dir-2
>
> all.simple:
> $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) all;)
...
> Are there other ways?
Sure. Using portable Make, you can write
all.simple:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir || exit 1; \
done
or using GNU extensions
all.simple:
$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) all || exit 1;)
Neither of these handle `make -k' nicely or `make -j' nicely, though,
so you may want a different solution, e.g. one along the lines of
this
all.simple: $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $*
or this
all.simple: $(SUBDIRS:=.dir)
%.dir:
$(MAKE) -C $*
(I didn't test any of these.)
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make