[Top][All Lists]

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

Re: Using the target of a pattern rule as a prerequisite

From: Paul D. Smith
Subject: Re: Using the target of a pattern rule as a prerequisite
Date: Fri, 4 Jun 2004 10:58:14 -0400

%% Noel Yap <address@hidden> writes:

  ny> Interesting.  Do you think this would've happened had they not
  ny> included identically-named header files.

Sure, and if people never made mistakes in programming then programs
would never have bugs :).

I think David's point is that the build system should be as robust and
reliable as possible _IN THE FACE OF_ incorrect decisions made by the
developers.  The tradeoff here is between safety and performance (as is
so often the case).  I think each group will need to make that decision
for themselves... and it may well change over time.

  ny> But they should all be within their own directories such that the
  ny> following is possible:

  ny>   #include <bar/foo.h>
  ny>   #include <baz/foo.h>

Sometimes this behavior is impossible to obtain with third-party code.
Sure, you could ensure that all your uses of headers put in the extra
directory, but you can't force the 3rd party headers to always use this
format internally!  Unless, of course, you change all their headers.

Nevertheless, I think this is a good setup and the one we use here: we
have a rule that each component gets one entry in the global include
directory.  If they export only one header file, they can use their
entry for a file directly.  If they export >1 header, they have to use
their one entry for a subdirectory to contain the headers, and follow
the #include method you mention above.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]