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 16:13:20 -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.
...
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

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

Ouch, somehow the quoting got terribly mangled in my previous reply; let me try again:

Fair point. Whether you consider it a defect or not 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.

Regarding your ".MULTI foo bar: baz" suggestion: that does not look like a traditional GNU make special target to me. A normal special target would look like this:

.MULTI: foo bar

which of course would be inadequate here since there's no way to make multiple distinct groups if you go that route and still with to maintain other aspects of makefile syntax (such as 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 together part of a multi-output group). I think the syntax you suggest looks like just yet-another-variant, except that the magic token is now ".MULTI" instead of "+" or "[ ]".

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":

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.




reply via email to

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