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: Eric Melski
Subject: Re: implementing emake's #pragma multi in GNU make?
Date: Thu, 3 Jan 2013 15:43:22 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

   On 01/03/2013 02:55 PM, David Boyce wrote:

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
([1]http://en.wikipedia.org/wiki/Fail-fast)".

   Fair point.  As with so many things, the interpretation depends on your
   specific priorities.  For us, it seemed worthwhile to maintain
   compatibility at least with serial GNU make builds, which should still
   work correctly for both incremental and full builds in such a scenario.

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

   Hmm, this doesn't really look like a GNU make special target to me.  A
   normal special target would look like this:
   .MULTI: foo bar
   which of course would be inadequate since there's no way to make
   multiple distinct groups if you go that route and still wish to
   maintain other aspects of makefile syntax (eg, that disjoint prereq
   specifications are aggregated), at least if you apply what I think is a
   natural interpretation of that syntax in this context (ie, that "foo"
   and "bar" are part of a multi-output group).  I think the syntax you
   suggest looks like just yet-another-variant, except the magic token is
   the somewhat-more-verbose ".MULTI" instead of "+" or "[ ]".

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

   Electric Make's documentation is publicly accessible from the Electric
   Cloud support portal.  The specific section you're looking for is 5-15,
   "Extension for Building Multiple Targets Simultaneously":
   [2]https://electriccloud.zendesk.com/attachments/token/isfw09p9nctmf8z/
   ?name=ea_emakegd6_2.pdf#page=47
   In short, $@ has the same meaning as it does in multiple-output pattern
   rules:  the target that first caused the rule to be run.
   Best regards,
   Eric Melski
   Chief Architect
   Electric Cloud, Inc.

References

   1. http://en.wikipedia.org/wiki/Fail-fast
   2. 
https://electriccloud.zendesk.com/attachments/token/isfw09p9nctmf8z/?name=ea_emakegd6_2.pdf#page=47


reply via email to

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