help-make
[Top][All Lists]
Advanced

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

Re: exception to Paul's Second Rule?


From: Paul D. Smith
Subject: Re: exception to Paul's Second Rule?
Date: Thu, 16 Oct 2003 18:13:20 -0400

%% Noel Yap <address@hidden> writes:

  ny> I'm trying to modularize the makefile so the value of OBJDIR
  ny> (which is way more than just one directory) is split among several
  ny> included makefiles.  I think shelling in each one isn't too
  ny> elegant.  Also, as hacked in the examples, make already knows the
  ny> directory name of the thing it's building.  Since the thing it's
  ny> building is dependent on the existence of the directory, wouldn't
  ny> dependency rules be the best way to represent that?

In one way, in that you need the directory before the target can be
built, it is a good way.

But prerequisites are a conflation of _TWO_ concepts, one is order as
above, but the other is rebuild dependency.  Do you want all the
contents of a directory to rebuild just because someone touched the
directory?  Or touched the directory marker file or whatever?  I think
not...

  ny> Of course, the hack itself wouldn't be necessary if something like
  ny> $$(@D) existed for pattern rules.  Would it make sense to have a
  ny> feature like this?

Not likely.

First, it's a totally different thing: the normal $$(@D) is handled as
the makefile is read in, using some special-case code to set up the
extra prerequisites.  If it were implemented for pattern rules it would
have to be done during the walk of the DAG, which would change the
contents of the DAG depending on the target, etc.  Gross.

Anyway, I don't like this syntax in the first place.  I only added it
because the SysV make users were so annoying :).  And, they were willing
to put some work in and send me a patch.

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