discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non recursive makefiles


From: Nicola Pero
Subject: Re: non recursive makefiles
Date: Fri, 14 Jan 2005 05:16:50 +0000 (GMT)

> > > For me, GCC and autogsdoc are the performance killers
> > > during compilation, make is fast enough even on a large tree.  I can't
> > > turn off GCC :-)
> > 
> > I don't think that recursion was "attacked" because it is too slow but 
> > because it prohibits -j 2.
> > And the latter will roughly double the performance of your GCC and 
> > autogsdoc on a two CPU system, which is very common (since this can be 
> > distributed very well on two (or more!) processors).
> 
> OK - thanks ... I'll try to look at that ('-j 2') again more seriously at
> some point.

I had a quick look again.

It's quite nice and simple, nothing to do with submakes vs monolithic
make, with fixes I think I can modify gnustep-make to work with 'make -j
2'.  It will look sequentially in the directories and targets, but when
building each of them it will unleash parallel compilations (which is what
matters most of the times, and I'd break a lot of user GNUmakefiles if I
let it compile stuff in the same makefile in an order which is different
from what the user specified -- many GNUmakefiles are implicitly relying
on this order to be maintained).

... There is a catch though which looks like the problem.

gnustep-make supports 'before-all' rules.  A 'before-all' rule should be
executed before everything else.  We currently do that by relying on the
order of prerequisites for rules, but in a parallel build you can't rely
on that.  So you'd have to have everything depend on 'before-all' to make
sure it's executed before everything else ... but that would cause
everything to be always rebuilt, because 'before-all' is a phony target
which always causes anything depending on it to be rebuilt.

I suppose the new order-only-prerequisites would be exactly what we need,
but those were added in GNU make 3.80 and we have been trying hard to
avoid new GNU make extensions to keep it as much portable as possible (not
to non-GNU makes, but to old GNU makes).

Even with the order-only-prerequisites it would be quite clumsy because
we'd have to try put before-all as an order-only-prerequisite to any build
rule.  And then if the user adds his own custom rules, they would need to
make sure each of their rules depend on before-all too ... which is
clumsy.

There might be a way out, I'd certainly like -j2 to be supported.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]