automake
[Top][All Lists]
Advanced

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

Trying to improve our dependency tracking


From: James Willenbring
Subject: Trying to improve our dependency tracking
Date: Thu, 1 May 2008 15:51:11 -0500

Hello,

 

I am trying to improve dependency tracking for a project I work on.  We have
a two level configure process.  Under the top configure process we have
about 40 semi-independent packages that have separate configure scripts.
Each package has at least one library archive associated with it and some
number of tests and examples.  Changes to header files (the project is
mostly written in C and C++) are typically recognized by the tests and
examples, but when we change a source file and the library is modified, the
tests and examples only relink if the particular library is listed in the
DEPENDENCIES primary associated with the executable.  What would be ideal
would be if it were possible to automatically figure out dependencies at a
source file level, rather than a library level, but I didn't see any way of
doing that.  I tried to specify the value for the DEPENDENCIES primary in
the same way we specify LDADD and CPPFLAGS, which is by using macro values
from another Makefile defined at configure time.  The dependencies are not
known until configure time because some packages can be optionally coupled,
so the dependencies depend on which packages are enabled.  For example, we
might say something like

 

include Makefile.export.packageA

 

myexe_LDADD = $(PACKAGEA_LIBS)

 

PACKAGEA_LIBS is calculated by knowing which packages are enabled (and in
some cases using some other scripts).

We have used this approach for a couple of years and it works just fine.  As
dependencies between packages change, only the packages whose direct
dependencies change need to be modified, if package A depends on package B
and package B adds a required or optional coupling with package C, package
A's build system does not need to be modified.

 

When I add

 

myexe_DEPENDENCIES = $(PACKAGEA_DEPENDENCIES)

 

$(PACKAGEA_DEPENDENCIES) is not resolved before dependencies are checked.
Despite the fact that I put the include directive at the top of the
Makefile.am, it shows up at the bottom of the Makefile.  If I manually move
the include directive higher in the makefile (but below the definition of
top_builddir), everything works as I would hope.

 

Does anyone have any suggestions for fixing this problem or for a different
approach I should take for dependency tracking?

 

Thanks

 

Jim Willenbring



reply via email to

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