[H-GEN] gnu make command-line target ordering problems?
Martin Pool
martinp at mincom.com
Sun Oct 17 21:04:07 EDT 1999
[ Humbug *General* list - semi-serious discussions about Humbug and
Unix-related topics. ]
Ben Carlyle wrote:
> The primary reason why I think it is not reasonable[1] is that this
> make behaviour is not compatable with the sun-style behaviour,
> which executes each target sequentially with permission within the
> generation of each target to execute in parallel[2].
But one could equally well say that the Sun make is inconsistent to
process command-line goals in sequence, but sub-goals in parallel.
Consider in any case that you might have
.PHONY: everything
everything: pre.source do.source post.source
as shorthand, and then do
make everything
which would give Sun make the same problem. Alternatively, write
everything:
$(MAKE) pre.source && $(MAKE) do.source && $(MAKE) post.source
and they will both do things in series.
I rather think the solution is do specify all the dependencies:
do.source: pre.source
post.source: do.source
and whatever else, which will give make the chance to parallelize
wherever it thinks appropriate. Perhaps after compiling one set of
templates it can then start to build code that depends upon them, while
doing the rest of the templates in the background. (Perhaps I
misunderstood you here?)
These rules can be hard to get right if you don't always want to
regenerate the templates, but even that can be fixed.
You might also like to look at the free PMAKE, which has more advanced
parallelism support.
> The secondary reason why I think it is not reasonable is this quote
> from http://www.dsv.su.se/comp/docs/make_81.html#SEC80.
There is a more recent version at
http://www.gnu.org/manual/make
which still does not explain -j terribly well, but which has some
suggestions, in particular in
http://www.gnu.org/manual/make/html_chapter/make_9.html#SEC83
> Finally, the source code it's self appears to support the single
> execution quite nicely. I have not had a chance to test my little
> hack as extensively as I want to, but it appears that by breaking
> up the goals list into bite-sized chunks for the update goal
> function one can achieve the same results as sun make. It is,
> however, a shame to do that as it looks like someone has put a
> fair bit of work into making it execute so nicely in parallel.
--
/\\\ Mincom | Martin Pool | martinp at mincom.com
// \\\ | Software Engineer | Phone: +61 7 3303-3333
\\ /// | Mincom Ltd. |
\/// | Teneriffe, Brisbane | Speaking for myself only
--
This is list (humbug) general handled by majordomo at lists.humbug.org.au .
Postings only from subscribed addresses of lists general or general-post.
More information about the General
mailing list