I just nailed the “sh: C:\Program: No such file or directory” bug. The troublesome space wasn’t in the PATH or in any makefile; it’s in the command used to launch your command prompt in the first place.
I’m using MSYS-Git on my system, and the Git Bash shortcut to get a bash prompt from which I’m building things (the standard windows command prompt can have issues when trying to build Linux-targetted makefiles.) The shortcut launches this command on my machine (x64):
C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
And forever after when make tries to launch another process bash will dumbly copy the path from that commandline across to the new process path. And fail horribly. Changing the shortcut to this fixes it for 32-bit windows:
C:\Windows\SysWOW64\cmd.exe /c ""C:\Progra~1\Git\bin\sh.exe" --login -i"
and this for 64-bit windows:
C:\Windows\SysWOW64\cmd.exe /c ""C:\Progra~2\Git\bin\sh.exe" --login -i"
bangs head against desk I think I need to go tell the msys-git people about this one…