[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Automake-NG] [PATCH 1/2] [ng] perf: disable GNU make builtin rules,
From: |
Stefano Lattarini |
Subject: |
Re: [Automake-NG] [PATCH 1/2] [ng] perf: disable GNU make builtin rules, for performance reasons |
Date: |
Wed, 27 Jun 2012 21:31:03 +0200 |
On 06/27/2012 07:40 PM, Dave Hart wrote:
> On Wed, Jun 27, 2012 at 17:30 PM, Bob Friesenhahn wrote:
>> On Wed, 27 Jun 2012, Stefano Lattarini wrote:
>>
>>> * lib/am/header-vars (MAKEFLAGS): Append '--no-builtin-rules'. This
>>> enhance performance by removing GNU make builtin rules that would be
>>> rather irrelevant (e.g., rules to automatically check out files from
>>> from RCS or SCCS repositories), or overridden by Automake (e.g., rules
>>> to compile C or C++ files). With this simple tweak, the null-build
>>> time on GNU coreutils on an aging Debian system goes down from ~ 20
>>> seconds to ~ 9 seconds.
>>
>>
>> This simple approach seems like a huge improvement. The improvement will
>> surely be larger if some/all of the files are accessed over a network.
>
> Yes, good stuff. Anyone who has debugged Makefiles with GNU make -v
> has seen the insane number of wasted operations due to combinatorial
> explosion exploring possible matches with builtin rules.
>
> Can Automake be similarly improved to disable GNU make's builtin rules
> without sacraficing compatibility with less-loved make implementations?
>
I think it would be easily doable; it would probably require a configure
time tough (similar to the one that is done to initialize '@SET_MAKE@').
Alas, this would have the side effect or rendering a Makefile created
from a configuration with GNU make early in PATH unusable with non-GNU
makes. Not a big deal, but an annoyance nonetheless.
Anybody volunteering a patch?
> If it's not practical for Automake to do this for
> all packages, how might a maintainer do it for his package without
> requiring GNU make?
>
He could provide a top-level GNUmakefile containing the
MAKEFLAGS += --no-builtin-rules
line early, and then including the Automake-generated Makefile:
include ./Makefile
But that will only clobber the built-in rules for builds launched from
the top-level directory, not from the subdirectories (another good
reason to switch to a non-recursive make setup).
Regards,
Stefano