Title: ways of recursing into subdirectory

I'm using make in a recursive fashion, and I was wondering if there's some nicer way than the two I can think of for doing this:

I have something like this:

SUBDIRS = foo bar

all:
        for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir; done

which works fine, but it's using the shell's for function.

Also, I have this:

SUBDIRS = foo bar

ALLDIR          = $(addsuffix .all,$(SUBDIRS))

all: $(ALLDIR)

%.all:
        $(MAKE) -C $*

Are there other ways?  Is one way preferred over another?

Reply via email to