autoconf
[Top][All Lists]
Advanced

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

Re: project in multiply directories


From: Ralf Corsepius
Subject: Re: project in multiply directories
Date: Mon, 28 Sep 2009 21:47:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3

On 09/28/2009 05:55 PM, Bob Friesenhahn wrote:
On Mon, 28 Sep 2009, Alfred M. Szmidt wrote:

There is an article called "recursive make considered harmful".
IMO, one of the most overrated articles of all times.

According to it, you should have just one Makefile.am in top level
with all the rules (all libs etc). By this, make can show its
strengths best. Often, a Makefile.am "per directory" seems to be
used, but for a new project today this should be avoided. It just
slows things down and leads to unneeded compiler calls.

I'm sorry, but where on earth did you get this terrible information?

A Makefile.am per directory is precisly what should be used, it
doesn't incure any extra compiler calls. It also makes it easy to
build seperate parts of the tree.

The main advantage of a Makefile per directory is that it makes it
easier to request building seperate parts of the tree.
Right. Exactly this is a huge win in bigger projects.

Otherwise the
approach can waste quite a lot of build performance since each sub-make
must stat(2) all off the files required by the Makefile target as well
as all of the generated source file dependencies, and there is quite a
lot of redundant processing (e.g re-linking) which does not need to
occur. A non-recursive build can help avoid depending on archive
libraries and "convenience" libraries which often consume quite a bit of
the build time.
Agreed, ... but the keyword is "can".

I have taken a number of large Automake-based projects (C and C++) to
non-recursive builds and have not regretted it.
I did the same and occasionally regret it. It's as in most situations: Everything comes at a price and all approaches have their use-cases.

Ralf





reply via email to

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