make-alpha
[Top][All Lists]
Advanced

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

Re: Output quoting (was: Re: Possible solution for special characters in


From: Tim Murphy
Subject: Re: Output quoting (was: Re: Possible solution for special characters in makefile paths)
Date: Thu, 10 Apr 2014 12:24:49 +0100

On 10 April 2014 11:56, Frank Heckenbach <address@hidden> wrote:
> Paul Smith wrote:
>>   FILENAME = foo\ bar biz\ baz
>>
>>   $(file >$(FILENAME),hi)
>>
>> Does this create a file 'foo bar biz baz'?  Or give an error because two
>> words were provided where one was expected?  Or something else?
>
> I'd say an error. We should be clear about what a string means and
> if a given string (like the above, or however else it will be
> written) is meant to contain multiple words and used in a
> single-word context, that's simply wrong and we should just tell the
> user so. Trying to interpret things differently depending on context
> is partly what got make into this predicament (WRT backslash
> handling), and it can be quite confusing, e.g.:
>
> $(FILENAME): ; $(file >$(FILENAME),hi)
>
> Define rules for two targets ("foo bar" and "biz baz") which
> actually create a totally different file ("foo bar biz baz")?
> No, better just error out.

Then how does one tell $(file) to create a filename with spaces in it?
how does one create a target with spaces in it?

$(file) requires > or << to start an argument and , as a delimiter.
So there is already a kind of context or type marker in this call.
Why not make > or >> generally the start of a filename and < or <<
generally the end?  or $(filename f) or any other pattern you choose.
Then you'd be doing little worse than the $(file) function does.

BTW $(file) has a bug and segfaults on blank input.

Regards,

Tim
-- 
You could help some brave and decent people to have access to
uncensored news by making a donation at:

http://www.thezimbabwean.co.uk/friends/



reply via email to

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