[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: With SHELL=cmd, make fails to execute bat file paths starting with .
Re: With SHELL=cmd, make fails to execute bat file paths starting with ../
Wed, 08 May 2013 20:05:05 +0300
> Date: Wed, 8 May 2013 09:49:22 +0200
> From: Erik Carstensen <address@hidden>
> Cc: Duane Campbell <address@hidden>, "address@hidden" <address@hidden>
> $(MAKE) 'a b'
> will complain that there is no target "a b", while
> call $(MAKE) 'a b'
> will complain that there is no target "'a".
> However, if I replace $(MAKE) with (cygwin's) touch, then both makefiles
> will create the file "a b".
> So, it seems that the CreateProcess call from make does not correspond
> exactly to the cmd.exe string, but to something very similar which some
> runtimes consider equivalent.
We already talked about this: the problem is not in how we call
CreateProcess, the problem is in the way Make parses the command lines
_before_ it passes them to CreateProcess. Specifically, when it
short-circuits, it uses quoting rules that support also '..' quoting
(for historical reasons). By contrast, when it decides to call
cmd.exe, it only uses quoting that is compatible with cmd.exe.
This is something to rectify in the future, but to make this really
correct, Make needs to support arbitrary Windows shells, not just
sh.exe and cmd.exe it supports now.