automake
[Top][All Lists]
Advanced

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

Re: Any way to get rid of -MP parameter to gcc for dependency creation?


From: Ralf Wildenhues
Subject: Re: Any way to get rid of -MP parameter to gcc for dependency creation?
Date: Fri, 7 Jan 2011 19:44:54 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Xan Lopez wrote on Fri, Jan 07, 2011 at 01:35:48PM CET:
> On Fri, Jan 7, 2011 at 7:31 AM, Ralf Wildenhues wrote:
> 
> > Can you, just for the sake of measuring performance, edit the generated
> > GNUmakefile and remove Automake's 'all' rule from it; something like
> >  sed -i '/^all: .*BUILT_SOURCES/,/^$/d' GNUmakefile
> >
> > It should really prove a big, not a small win, otherwise it's not worth
> > looking at this further.
> 
> Indeed, it cuts the total time almost exactly in half.

Very well then.

> Will this also go into the gnu-make mode or is it something we'd have
> to hack locally?

Good question.  The answer has two parts:

- Overriding the 'all' rule in the .am file should probably be possible,
  under the expectation that the author knows what she's doing.  We
  should ensure two things however: warn (without -Wno-override), and
  ensure that 'all' remains the first target mentioned in the Makefile
  (this could probably also be done by just adding a stub 'all:' dummy
  in $output_all).  It should be noted however that any such overriding
  must be considered a hack, as the details of the 'all' rule are
  Automake internals.

- Generally avoiding make recursion upon config headers or BUILT_SOURCES
  is trickier than avoiding -MP.  Most projects using Automake will
  probably work with something like this:

    %.$(OBJEXT): | $(BUILT_SOURCES) $(generated_headers)
    %.lo: | $(BUILT_SOURCES) $(generated_headers)

  but BUILT_SOURCES are also used for other things than generated
  header files, and there might be other files depending on them.
  So we need some way for users to be able to specify such sets of files
  if we want to remove this recursion reliably.  And then we need to
  consider the possibility that BUILT_SOURCES of the latter kind depend
  on object files to be created beforehand.  Users get fairly annoyed if
  the build tools creates circular dependencies upon benign input files.
  ;-)

With the first part addressed, at least you will be able to hack locally
by merely providing some extra code in GNUmakefile.am (without the need
to post-process a generated file).

BTW, a similar optimization can probably be made for other recursions,
e.g., check, and maybe also install; but the latter has more
complications.

Cheers,
Ralf



reply via email to

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