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

Frank Heckenbach <[email protected]> Fri, 11 Apr 2014 11:53:32 +0200
Newsgroups gmane.comp.gnu.make.devel
Message-ID <[email protected]>
Tim Murphy wrote:

> On 11 April 2014 09:32, Eli Zaretskii <[email protected]> wrote:
> >> Date: Thu, 10 Apr 2014 22:55:34 +0200
> >> Cc: [email protected], [email protected]
> >> From: Frank Heckenbach <[email protected]>
> 
> >> Now, if you want to use another interpreter with different quoting
> >> rules, you can do:
> >>
> >> SHELL = /bin/frob
> >> SHELL_QUOTE = $(subst or whatever ...)
> 
> This seems like a very specific name for a very general ability.  e.g.
> by setting SHELL_QUOTE I might build up a list of files used in the
> build and write them to a file with $(file).  I have often wanted this
> so I anticipate other people wanting it too.

I haven't used $(file) myself, so correct me I'm wrong, but I think
in this case make writes the contents itself, so if you just want
the list of plain file names, they don't need to be quoted and make
probably shouldn't apply automatic quoting here.

Of course, writing them this way is not unique either, both foo\ bar
(one word) and foo bar (two words) would appear as foo bar,
undistinguishable.

The qustion then is, how would you want the output to look like? Do
you want it in quoted form, i.e. (literally) foo\ bar in the file.
In this case, you might apply SHELL_QUOTE manually which kind of
makes sense because you specifically want the output in shell-quote
form.

But perhaps you want the output one word (file name) per line. In
this case, you need another "quoting" function which inserts
newlines between words ...

> Surely it's something like AUTOVAR_EXPAND?

In the end, I don't care too much about the name. I thought of
SHELL_QUOTE because it would usually be changed in accordance with
SHELL to select another interpreter. (Of course, not all
interpreters are shells in the first place, but SHELL is a
well-established name for this purpose in make.)