bug-make
[Top][All Lists]
Advanced

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

RE: GNU make to consider files checksum


From: lasse.makholm
Subject: RE: GNU make to consider files checksum
Date: Mon, 5 Oct 2009 15:57:06 +0200

Tim Murphy wrote:
> I think that checksumming might benefit some targets.  It would be
> nice to be able to implement different "methods" for different targets
> - because not all methods work well in all circumstances.

> I have one example where every single file in a huge build includes 1
> particular header file.  The file defines macros which are the
> features that are enabled or disabled in the build.
>
> We know which features are used by particular components so in theory
> we could work out not to rebuild components that are not influenced by
> what's happened to the header file.  e.g. we could switch on a feature
> or add a new feature without forcing a rebuild of the entire source
> base.

You can do that already today by simply splitting your global feature
header file into smaller pieces and letting targets depend on only
the relevant pieces rather than everything...

Of course that means you have to know which targets need which
pieces of the feature set to define the correct dependencies but
that's the price you pay for properly functioning incremental
rebuilds. You can't have your cake and eat it too...

This sort dependency generation can usually be automated fairly
easily though, but it's something that is highly dependant on your
software architecture, build structure, programming language,
etc...

For that reason it belongs in your makefiles and not in GNU make
itself... 

> This requires something like md5 but also some kind of "filter" to
> determine what kinds of changes are significant to the particular
> target that you are testing the dependency for

IMNSHO, this is not a problem that make can (or should even attempt
to) solve for you. This "filter" as you call it would have to know a lot
about the the syntax your header and code files which makes it a bad
candidate for a core make feature.

This is the classic "global.h" problem of large software builds...

> You can emulate md5 checksum dependencies  in make of course, using
> temporary marker files, but it's a bit ugly and complicated..

This problem is not strictly related to MD5 summing. With MD5 summing
instead of timestamps, your global header file would still change and
cause a full rebuild because this is what you explicitly asked for by saying
that all targets depend on it.

/Lasse




reply via email to

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