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 14:16:23 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/03/2013 11:11 AM, Paul Smith wrote:
On Thu, 2013-01-03 at 05:53 -0800, Jamie Cuesta wrote:
http://blog.melski.net/2013/01/01/pragma-multi-and-rules-with-multiple-outputs-in-gnu-make/
 describes a (IMHO very significant, perhaps even "gaping") limitation of GNU 
make (and offers a (IMHO) clean/elegant solution to same).

http://lists.gnu.org/archive/html/make-alpha/2002-12/msg00000.html

There may have been other similar threads since, I can't remember.

I'm not so thrilled about the idea of having a #pragma concept that
changes the way normal rules are interpreted.

We chose the #pragma syntax for two reasons. First, it entirely avoids the debate about what syntax to use to indicate multiple output targets. From the linked thread that seems to have been a point of some contention, and there's disagreement between different make variants -- some use "a + b", some use "[a b]", somebody proposed using something like "a b |:" or similar. All of the alternatives have drawbacks, albeit perhaps not anything that would actually impact users in practice (eg, what if you actually want to have a target named "+"?).

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.

Best regards,

Eric Melski
Chief Architect
Electric Cloud, Inc.




reply via email to

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