> Date: Sat, 27 Apr 2013 21:48:54 +0200 > From: Erik Carstensen <mandolae...@gmail.com> > > I have the following makefile: > > SHELL=cmd.exe > default: > "a b.bat" xy > "a b.bat" "x y" > a\ b.bat xy > a\ b.bat x\ y > > I also have a file 'a b.bat', which contains a single line: > echo a b > > Now when I run make, this happens: > > /tmp$ /cygdrive/c/mingw64-i686-20110207/bin/make.exe > "a b.bat" xy > a b > "a b.bat" "x y" > a b > a\ b.bat xy > > C:\cygwin\tmp>echo a b > a b > a\ b.bat x\ y > 'a' is not recognized as an internal or external command, > operable program or batch file. > make: *** [default] Error 1
Thanks for the report. (Any real reason to use batch files whose names include whitespace?) > I think the problem is in the lpCommandLine parameter to CreateProcess, > where argv[0] needs cmd.exe-style quoting of spaces if it is a .BAT file I don't think so. If you add --debug=j switch to the Make command line, you will see that the quoting is perfectly correct. So this looks like some quirk of CreateProcess, either with batch files or with any command with embedded spaces. Exactly how to format the 1st and the 2nd arguments to CreateProcess when they include whitespace is insufficiently documented, and CreateProcess invokes a variety of heuristics that make the job of discovering its rules all but impossible. Note that it only fails if both the batch file name and its argument are quoted and include whitespace; if any one of the two does not have whitespace, the command works. I will try to find a good solution to this when I have time. _______________________________________________ Make-w32 mailing list Make-w32@gnu.org https://lists.gnu.org/mailman/listinfo/make-w32