%% "Robert P. J. Day" <[EMAIL PROTECTED]> writes:
rpjd> however, reading the make manual, i see an alternative form of
rpjd> processing SUBDIRS that i prefer, since it supports parallel
rpjd> processing and subdirectory dependencies:
rpjd> SUBDIRS = d1 d2 d3
rpjd> .PHONY: subdirs ${SUBDIRS}
rpjd> subdirs: ${SUBDIRS}
rpjd> ${SUBDIRS}:
rpjd> ${MAKE} -C $@
rpjd> d1: d2 # potential subdir dependency
rpjd> but this second form doesn't accommodate a subdirectory target, such
rpjd> as "configure" or "clean".
I used suffixes for this before, like this:
SUBDIRS := d1 d2 d3
TARGETS := clean all configure
ALLSUBDIRS := $(foreach t,$(TARGETS),$(addsuffix .$(t),$(SUBDIRS)))
clean: $(addsuffix .clean,$(SUBDIRS))
all: $(addsuffix .all,$(SUBDIRS))
configure: $(addsuffix .configure,$(SUBDIRS))
$(ALLSUBDIRS):
$(MAKE) -C $(patsubst .%,%,$(suffix $@)) $(basename $@)
or whatever. You can use $(eval ...) to make this much more clean. And
you'll need to make sure you declare all that stuff (certainly the
directories themselves) .PHONY.
Dependencies are more painful but again you can use loops and eval to
handle it.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make