help-make
[Top][All Lists]
Advanced

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

Re: advanced auto-dependencies


From: Paul D. Smith
Subject: Re: advanced auto-dependencies
Date: Fri, 6 Feb 2004 12:53:38 -0500

%% Boris Kolpackov <address@hidden> writes:

  bk> I think I found a flaw in a so-called "advanced auto-dependencies"
  bk> generation technique.

I think there is just a flaw in the explanation.

It's known, but not explained well in the document, that you can't use
this method with derived elements.  It only works with source elements
(leaves on the dependency graph).

  bk> This reasoning ignores the case when some of the prerequisites may
  bk> not exist and should in turn be built. In this case we do need
  bk> up-to-date dependency list in this build.

It's not the case that this method can create your whole makefile for
you!! :)

If you have "inner" prerequisites you have to declare them yourself; the
method won't intuit them for you.  As I said above, it only works for
leaf prerequisites.

  bk> client : client.o hello_stub.o
  bk>   g++ -o $@ $^

  bk> -include client.o.d      # dependencies for client.o
  bk> -include hello_stub.o.d  # dependencies for hello_stub.o

  bk> hello_stub.hpp hello_stub.cpp : hello.idl
  bk>   idlc hello.idl

You need to explicitly declare the "inner" dependency relationship
between client.o and hello_stub.hpp, since hello_stub.hpp is not a leaf
in the graph.

-- 
-------------------------------------------------------------------------------
 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]