help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: removing compile directive


From: Dave Korn
Subject: RE: removing compile directive
Date: Fri, 25 Apr 2008 19:02:05 +0100

grischka wrote on 25 April 2008 17:32:

> From: "Dave Korn":
>
>> From: grischka
>>>
>>> I mean, basically it is very clear what the writer of above line
>>> has in mind, so the program could as well support it.
>> 
>>   I assume the "very clear" intention that you perceive the writer to
>> have had in mind is this: 
>> 
>> CFLAGS := $(filter-out -D_REMOVE_THIS_,$(CFLAGS))
>> 
>> i.e. a non-recursive operation; and that you are suggesting that make
>> could overlook the fact that what they actually wrote was an operation
>> that recurses infinitely because it has no termination condition.
> 
> What I mean is that it is not obvious that it has no termination condition,
> anyway less obvious than that it could have one.
> 
> Just as you could see 'CFLAGS += -Dxxx' also as an impossibility with
> no termination condition, but it is more useful if you don't.

  No it isn't: in fact, that's the very reason why the += syntax exists; it
allows you to append something yet still retain deferred evaluation.

  Your assumption that 'CFLAGS += -Dxxx' is the same statement as 'CFLAGS =
$(CFLAGS) -Dxxx' is not quite right; although your assumption that it's not
the same as 'CFLAGS := $(CFLAGS) -Dxxx' is correct, it's a fallacy of the
excluded middle to assume that the only other possibility is the deferred
assignment.

  In fact, += is not an operation that can be translated into a plain-old
assignment and still retain the same semantics.

> Similar in the general case the more obvious model incidentally also
> seems to be the more useful one, because (if supported) it allows
> you to emulate 'CFLAGS -= -Dxxx' by other facitilities that GNU make
> already has, quite easily. 
> 
> Btw, could be I saw '-=' in jam (or maybe some other make program).

  You have, of course, identified a good reason for adding a '-=' operator to
make, by analogy to why '+=' exists.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....





reply via email to

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