help-make
[Top][All Lists]
Advanced

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

Re: implementing emake's #pragma multi in GNU make?


From: David Boyce
Subject: Re: implementing emake's #pragma multi in GNU make?
Date: Thu, 3 Jan 2013 17:55:52 -0500

On Thu, Jan 3, 2013 at 5:16 PM, Eric Melski <address@hidden> wrote:
> The second advantage of #pragma syntax is that it is not
> backwards-incompatible.  A makefile using "#pragma multi" will still be
> usable with older versions of GNU make, except that you don't get the
> special multi-output behavior.  In the best case, the alternatives will
> cause older versions of GNU make to emit spurious warnings; in the worst
> case they could cause build failures.  "#pragma multi" is completely
> invisible to versions of GNU make that don't support it.

Eric,

I'm not disagreeing with your overall approach but fairness requires
noting that this could just as well be spun as a bug as a feature.
E.g. "the alternatives would squawk when used with a version that
doesn't support them, whereas the pragma would be silently ignored
leading to potentially incorrect incremental builds
(http://en.wikipedia.org/wiki/Fail-fast)".

The traditional pragma-like mechanism in make is the special target.
Has anyone considered implementing that way? E.g.

.MULTI foo bar: baz
        touch foo bar

(one could ask "what if I want a target called .MULTI?" but I think
the entire /^\.[A-Z]+/ namespace is at least unofficially reserved).
But I guess the pragma is a fait accompli and it's up to GNU make to
implement it or not.

Also, the blog post doesn't discuss automatic variables. What happens
with them in this case? Is there public (non-customer) documentation?

-David Boyce



reply via email to

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