help-make
[Top][All Lists]
Advanced

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

RE: how to filter-out a word sequence?


From: Dave Korn
Subject: RE: how to filter-out a word sequence?
Date: Fri, 5 Jan 2007 16:12:20 -0000

On 05 January 2007 16:05, David Boyce wrote:

>> Option 3)
>>    $(subst -z foo,,$(args))
>>    ...but that fails if there are multiple spaces or a tab between
>> the -z and 'foo'
>> 
>> Option 4)
>>    $(subst -z foo,,$(strip $(args))
>>    ...but that replaces *all* internal whitespace in $(args) with
>> single spaces
> 
> Fortunately this build system is generating its Makefiles so we can
> be certain that command line formats are entirely regular.

  And indeed, judicious use of $(strip ....) to normalise/canonicalise the
whitespace in a variable can get round that anyway, which is helpful if you
want to allow users to supply manual overrides in environment variables (or
make variables set on the command-line invocation), since anything entered
manually might well have a stray space or two in it.


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





reply via email to

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