help-make
[Top][All Lists]
Advanced

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

Re: prerequisite staleness criteria


From: Dave Hylands
Subject: Re: prerequisite staleness criteria
Date: Mon, 17 Apr 2006 14:12:12 -0700

Hi Lynne,

On 4/17/06, Lawrence, Lynne <address@hidden> wrote:
> Folks,
>
> Is there a way, with GNU make, to alter the criteria it uses to test
> whether a prerequisite is stale?
>
> For instance, when determining whether to copy a file from a build
> directory to an install directory it would be convenient to copy only if
> the file checksums differ, regardless of whether the file in the build
> directory is newer.

I often do this manually. I'll have make create a file with a name
which is slightly different from the target (like by appending .tmp or
similar). If the .tmp file is identical to the target, I' remove the
.tmp file. If the .tmp file differs from the target, then I'll copy
it.

This way you can have the file change when needed, but not force a
recompile with every make.

An example where I use this it to create a .h file which contains the
SVN revision of the current directory, which is used as part of a
version string.

It's quite useful to use this technique for any generated source files.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

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