automake
[Top][All Lists]
Advanced

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

Re: Dependency issues after adding new sources.


From: Ralf Wildenhues
Subject: Re: Dependency issues after adding new sources.
Date: Fri, 11 Sep 2009 19:59:37 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

Hello Dave,

* Dave Steenburgh wrote on Fri, Sep 11, 2009 at 05:24:58PM CEST:
> I have this problem with several of my programs, but it's most frustrating
> with my current program, which at the moment has a flat directory structure.
>  The program in question is developed little by little, so from time to time
> I need to add new source files to the program's _SOURCES in Makefile.am.  I
> was under the impression that after doing so, running make from the build
> directory would magically figure everything out and build the program
> correctly.

That should typically work; so let's find out why it doesn't work for
you:

- do you use AM_MAINTAINER_MODE?  If yes, then please
   ./configure --enable-maintainer-mode

so that autotools are rerun when and as needed.

- can you do the following:
   echo 'int unused_function () { return 0; }' > foo.c
   echo 'program_SOURCES += foo.c' >> Makefile.am
   make

(please adjust the program_SOURCES variable to match your names) and
post all output of these commands literally (i.e., cut and paste)?

- What system are you on, what compiler, 'make' program do you use?

> What happens instead is the Makefile appears to be regenerated,
> but my new sources are not included in it.  I have tried multiple methods to
> fix this, most of them to no avail.  Currently, the new sources are built
> and are linked into the executable, but most of the old sources aren't being
> rebuilt when a common header is changed.  The only thing that fixes all the
> issues is to start with an empty build directory and re-run the configure
> script.

Ah, that sounds like only dependency tracking is not enabled.  Please
try passing --enable-dependency-tracking to configure (which also turns
on slow dependency extractor mechanisms).  Show us the configure output,
esp. where it says "dependency mode of ...".

The point here is that without the switch, only fast dependency
extractors are tried out: those which can be run as side-effects from
compilation.

> I doubt that it's really necessary to create a new build directory
> every time I add a new class.  So what could I be doing wrong?  I will
> gladly share any information about my build environment that may help a
> diagnosis, but I'd prefer to keep the code private.

That's fine really.

Cheers,
Ralf




reply via email to

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