help-make
[Top][All Lists]
Advanced

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

RE: Long builds and dependency checking


From: Paul D. Smith
Subject: RE: Long builds and dependency checking
Date: Wed, 1 Aug 2001 14:15:21 -0400

%% "Bhatt, Milan C" <address@hidden> writes:

  bmc> I would like to avoid this problem, but its impossible since some
  bmc> of these builds take several hours and perhaps even days.  During
  bmc> the build time, users have to make changes to the prerequisites
  bmc> files as they become necessary.  It would be messy to have a
  bmc> separate area for builds and a separate area for where changes
  bmc> can be made since you'd have a replication data in different
  bmc> places which can get very confusing as the project gets large.

This is typically why one uses a source code control system :).

  bmc> It would be nice if this was a future feature in gmake though :)

These both seem pretty hacky and special-case to me! :)


The solution to your problem lies in a feature that's long been on the
TODO list: stateful makes.  That is, instead of relying on comparing the
timestamps of the target with its prerequisites to see if any are out of
date, make keeps a state file containing information about each
prerequisite showing its mod time the last time make was invoked.

Then instead of comparing relative timestamps you compare the timestamp
of a file to its last known timestamp; if they're different, the file
has changed.

This also solves problems related to source code control tools which
don't set timestamps to "now" when you get a new version, such as
ClearCase... the timestamp might be older than the target that depends
on it, but it's not the same as it was last time so that file is
considered to have changed.


The implementation of this in general is actually relatively simple.
The hard part is robustness (locking, etc.: what if you have recursive
builds within the same directory?  What about parallel
builds/distributed builds?)

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