On Wed, Feb 5, 2014 at 12:50 PM, Jeff King <p...@peff.net> wrote:
> It's a common pattern in our Makefile to echo some make
> variables into a file, but only if they are different from a
> previous run. This sentinel file can then be used as a
> dependency to trigger rebuilds when the make variable
> changes.
> The code to do this is a bit ugly and repetetive; let's


> factor it out into a reusable function.
> Note that this relies on the "call" and "eval" functions of
> GNU make. We previously avoided using "call", as explained
> in 39c015c (Fixes for ancient versions of GNU make,
> 2006-02-18). However, it has been 8 years since then, so
> perhaps its use is acceptable now.
> The "call" function dates back to GNU make 3.77.90
> (1997-07-21). The "eval" function dates back to 3.80
> (2002-07-08).
> If it's still a problem to use these functions, we can
> do similar meta-programming with something like:
>         include magic.mak
>         magic.mak:
>                 ./generate-magic-rules >$@+
>                 mv $@+ $@
> where the rules are generated by a shell (or other) script.
> Signed-off-by: Jeff King <p...@peff.net>
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to