[Top][All Lists]

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

Re: Content-based dependencies

From: Yang Zhang
Subject: Re: Content-based dependencies
Date: Wed, 06 May 2009 11:10:20 -0400
User-agent: Thunderbird (X11/20090318)

Mike Shal wrote:
On 5/6/09, Yang Zhang <address@hidden> wrote:
Is there a way to have GNU make cache copies of source files, so that when
rules are triggered by timestamp comparisons between targets and sources, it
will also compare the current source with the cached source to make sure
that it actually changed before executing the actions (only executing if
they differ)?

This sounded familiar - I found some older threads on the issue:

Also the solution here may work for you:

Ultimately what is your goal here? Are you trying to avoid the "change
a comment in a header rebuilds everything" issue, or do you have some
other timestamp problems? Keep in mind that doing a diff or using a
checksum to determine out-of-dateness isn't exactly cheap - you may be
trying to optimize a corner case to the detriment of the general case.

That's close to what I'm trying to do. I'm using code generation tools that produce sets of files (e.g., lzz produces .h and .cc files). In that example, usually only the .cc file changes, but the .h file also gets touched, causing all the other .cc files that depend on it to get recompiled as well.
Yang Zhang

reply via email to

[Prev in Thread] Current Thread [Next in Thread]