help-make
[Top][All Lists]
Advanced

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

Re: Make: Using directories as dependencies???


From: Paul D. Smith
Subject: Re: Make: Using directories as dependencies???
Date: Mon, 14 May 2001 21:25:36 -0400

%% Ken Glasson <address@hidden> (by way of Ken Glasson
%% <address@hidden>) writes:

  kg> I want the directory to be created if it doesn't exist - so have set it
  kg> as a dependency for the target objects:

No.  Very bad idea.

Look in the GNU make manual section "Phony Targets" for an example of
how to do this the Right Way.

  kg> When used this way and make is run repeatedly I get objects (and
  kg> binaries - not shown) being rebuilt unnecessarily due to what appears to
  kg> be the fact the the timestamp of the $(OBJLOC) directory is being
  kg> updated every time a new object is placed into it....

Yes, of course.  To make a target is a target is a target, and in UNIX
the modification time of a directory changes every time a file is added,
removed, or renamed in the directory.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "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]