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: Frank Heckenbach
Subject: Re: Output quoting (was: Re: Possible solution for special characters in makefile paths)
Date: Thu, 10 Apr 2014 19:47:32 +0200

Tim Murphy wrote:

> On 10 April 2014 12:37, Frank Heckenbach <address@hidden> wrote:
> > Tim Murphy wrote:
> >
> >> On 10 April 2014 11:56, Frank Heckenbach <address@hidden> wrote:
> >> > 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?
> >
> > By quoting the space (the details of which are just being discussed).
> 
> Paul wrote that this:
>    FILENAME = foo\ bar biz\ baz
> 
>    $(file >$(FILENAME),hi)
> should return an error.

Because it contains an unquoted space which would be a word-separator.

If you want a single file name, write:

    FILENAME = foo\ bar\ biz\ baz

> I was suggesting >> as an argument why start/end delimiters  such as
> $[ and ] are
> not so bad because make already has delimiters for function parameters
> such as those
> of $file - whether or not it uses them.

Unfortunately, that's not enough. Consider a function such as
$(filter). It has 2 arguments (separated by a comma). Each of those
arguments can be a list of strings, separated by whitespace. So each
of those strings cannot contain a comma or whitespace yet. When we
we want to change that, we'll need some way of quoting or escaping,
whether \, $[] or whatever.



reply via email to

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