[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: make dependency on parts of a file
On Fri, Apr 04, 2014 at 01:51:09PM +0200, Edgar Fu? wrote:
> Suppose I have a file A and another file B depending on only parts
> of A. That is, if (the time stamp of) A changes, it is quite
> likely that B (derived from A) will not. Suppose it's cheap to
> build B from A (or to check whether B actually changed). Then
> suppose there's C, which depends on B but is expensive to build.
> Is there a sane way to rebuild C only if the relevant parts of A changed?
Not that tidily, but you can do something like this:
if diff -q B.reference B; then cp B B.reference; fi
If that doesn't work, you can also do
if diff -q B.reference B; then cp B B.reference && $(MAKE) C; fi
The netbsd build does something like this for installing header files;
I don't remember offhand if it's a mess or a decent example.
David A. Holland
Main Index |
Thread Index |