Makefile error make (e=2): The system cannot find the file specified Makefile error make (e=2): The system cannot find the file specified windows windows

Makefile error make (e=2): The system cannot find the file specified


The error

process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, ...) failed.make (e=2): The system cannot find the file specified.

is almost certainly complaining that Windows cannot find pscp.

This is almost certainly because the value of %PATH% (or whatever) is different when make spawns a shell/console then when you have it open manually.

Compare the values to confirm that. Then either use the full path to pscp in the makefile recipe or ensure that the value of PATH is set correctly for make's usage.


I know this is an old question that has been answered, but thought I'd and my experiences for anyone still running into this. I was getting the same cryptic error Colonel Beauvel (though with the windows MOVE command, not pscp):

process_begin: CreateProcess(NULL, move /y foo\bar.c .\baz.c, ...) failed.make (e=2): The system cannot find the file specified.

Our CI was running the same Makefile and working perfectly. Turns out CI was using mingw32-make and I was using GNU make. Uninstalling GNU make (which got installed as part of an unrelated bulk package) and aliasing mingw32-make to 'make' works perfectly.


In my case, I had git\bin in my %PATH% which contains bash.exe and sh.exe.
Removing %GIT_HOME%\bin from the PATH worked for me.