help-make
[Top][All Lists]
Advanced

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

Re: Dependancy DB & recursive make


From: Paul D. Smith
Subject: Re: Dependancy DB & recursive make
Date: Mon, 14 Mar 2005 11:21:29 -0500

%% Tristan Van Berkom <address@hidden> writes:

  tvb> The problem is that dependancies are not getting re-evaluated
  tvb> over sub-makes; resulting in useless `$(MAKE)' invokations.

  tvb> example:
  tvb>      - `app' depends on `lib-one' and `lib-two'
  tvb>      - `lib-two' depends on `lib-one'
  tvb>        - make in `app' dir recurses into `lib-one' and rebuilds
  tvb>        - make in `app' dir recurses into `lib-two'
  tvb>          - make in `lib-two' dir recurses into `lib-one' dir
  tvb>            (Nothing to do in lib-one dir "duh !")
  tvb>        - make in `lib-two' dir rebuilds
  tvb>        - make in `app' dir rebuilds

  tvb> Is there anything I can do so that make updates its table of
  tvb> dependancies properly or sub-makes start off with a clean slate
  tvb> of dependancies ?

Since you haven't told us HOW you've written your makefile to inform
make that it needs to recurse, we can't help you directly.

Remember that a sub-make is a completely different program than its
parent: it has absolutely no idea what targets the parent knows about,
what targets it has or has not already built, etc.  The sub-make is
invoked from scratch, reads its own makefile, and makes up its own mind
about when things need to be rebuilt based on out-of-date
considerations, etc.


If the make running in lib-two decides, from first principles, that
lib-one is not up-to-date then it will rebuild it, regardless of whether
the parent make already built it or not.

So, the question again is: how is your makefile programmed to decide
whether or not lib-one is up-to-date?  If you're seeing lib-one rebuilt
multiple times then you have an error in that makefile logic.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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