[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to enforce ordering on a set of targets?
From: |
Robert P. J. Day |
Subject: |
Re: how to enforce ordering on a set of targets? |
Date: |
Thu, 27 Jan 2005 11:08:28 -0500 (EST) |
On Thu, 27 Jan 2005, Noel Yap wrote:
> Robert P. J. Day wrote:
>
> > On Wed, 26 Jan 2005, Paul D. Smith wrote:
> >
> > ok, here's what i'm doing in a bit more detail. it's a recursive
> > make, where i'm using a trick i saw (in the make manual, i think) that
> > allows me to process subdirectories in parallel. in slightly
> > simplified form:
>
> IIUC, this "trick" is no longer necessary.
ok, i'm curious about this claim since i don't see how it can be
avoided.
AFAIK, the historical way to recursively process subdirectories was in
a loop:
SUBDIRS = d1 d2 d3 d4 d5
and you could define a macro called, say, MAKE-SUBDIRS, as
define
MAKE-SUBDIRS
@for d in $(SUBDIRS); \
do \
if test -d $$d; then \
echo $(MAKE) -C $$d $@; \
$(MAKE) -C $$d $@; \
else \
echo DIR $$d skipped; \
fi; \
done
endef
and then define each action target with something like:
clean:
${MAKE-SUBDIRS}
now, this would work but, as i read somewhere (the online make
manual?), the drawback is that you can't parallelize the processing of
the subdirectories.
the alternative approach is to do something like this:
SUBDIRS = d1 d2 d3 d4 d5
TARGETS = clean configure build
.PHONY: ${TARGETS} ${SUBDIRS}
${TARGETS}: ${SUBDIRS} (rule [1])
now, for each subdirectory, i might have a slightly invocation:
d1:
${MAKE} -C d1 ${MAKECMDGOALS}
d2:
${MAKE} -C d2 (options just for d2 perhaps) ${MAKECMDGOALS}
and so on. now, i can call this makefile with
$ make clean
and, based on rule [1] above, i should be able to process those
subdirectories in parallel, no? which, AFAICT, i *can't* do using the
more common loop construct.
am i misunderstanding this? is there an easier way to get what i
want?
rday
- Re: how to enforce ordering on a set of targets?, (continued)
- Re: how to enforce ordering on a set of targets?, Robert P. J. Day, 2005/01/26
- Re: how to enforce ordering on a set of targets?, Robert P. J. Day, 2005/01/26
- Re: how to enforce ordering on a set of targets?, Noel Yap, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Paul D. Smith, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Noel Yap, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Paul D. Smith, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Noel Yap, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Paul D. Smith, 2005/01/27
- Re: how to enforce ordering on a set of targets?,
Robert P. J. Day <=
- Re: how to enforce ordering on a set of targets?, Paul D. Smith, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Robert P. J. Day, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Noel Yap, 2005/01/27
- Re: how to enforce ordering on a set of targets?, Paul D. Smith, 2005/01/27