> Date: Fri, 3 May 2013 17:17:20 +0200
> From: Erik Carstensen <mandolae...@gmail.com>
> 
> When passing """" """" to a shell, it is evaluated to a single word " " if
> cmd.exe evaluates it, but  to an unquoted single space if make
> short-circuits the cmd.exe argument.

You should use a backslash to produce a literal quote that should be
passed to a program.  That's what the Microsoft startup code provides
as the way to get quote characters into programs.

Unfortunately, cmd.exe does not support such escaping, so Make needs
to choose which method to support, and it naturally leans towards
programs rather than towards cmd.exe itself, because the commands that
need the shell or explicit batch files are the minority.

If you do know that cmd.exe will be invoked, you can either double the
quotes, as the cmd.exe documentation describes, or us the ^ character
to escape the quotes.

> My actual use case is similar to the 'mkdir' invocation in foo.mk (a file
> with spaces needs to be quoted twice in order to be passed to commands in a
> recursive make).

Please show that use case, or something similar.  I don't immediately
understand why recursive invocation means you'd need to quote a file
name twice.  E.g., why not use this instead:

SHELL=cmd.exe
default:
        $(MAKE) -f foo.mk x="a b"


_______________________________________________
Make-w32 mailing list
Make-w32@gnu.org
https://lists.gnu.org/mailman/listinfo/make-w32

Reply via email to