On 09/15/2013 11:12 PM, Diego Elio Pettenò wrote:
On Sun, Sep 15, 2013 at 7:16 PM, Jules Colding <cold...@venalicium.dk>wrote:
So, how do I tell the top-level Makefile.am that it should traverse all
sub-directories building only the libraries, and then traverse the
sub-directories again building only the test applications?
You don't.
This is one of the reasons why you shouldn't be using recursive makefiles...
I agree. As soon as your subdirectories start to have non-trivial
interdependencies (or even trivial ones IMHO), you should definitely
switch to a non-recursive build setup if you want to avoid subtle
bugs and inconsistencies (and retain your sanity in the long term).
See also the famous paper "Recursive make considered harmful" for details:
<http://miller.emu.id.au/pmiller/books/rmch/>.
Automake 1.14 should now make it easier to have non-recursive setups, thanks
to the new "Relative directory in Makefile fragments" feature (see NEWS file
for details, or read them on-line at
http://lists.gnu.org/archive/html/automake/2013-06/msg00040.html.
Again, kudos to Peter Rosin for implementing most of that feature).
Regards,
Stefano