I am using a makefile in windows to push some files on a Unix server (here a text file "blob.txt" in the same folder of my makefile). My makefile script is:
setup: pscp blob.txt username@hostname:/folder/
I start a command prompt, go in the folder where blob.txt and the makefile are present and type:
make setup
Which results in:
pscp blob.txt username@hostname:/folder/ process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, ...) failed. make (e=2): The system cannot find the file specified. make: *** [setup] Error 2
In a #fail ... whereas if I enter directly the command in the command prompt:
pscp blob.txt username@hostname:/folder/
It works ... I really wonder why.
Use SFC to fix system cannot finds the file specified error. In Command Prompt, type the following command: “sfc /scannow”. Now press Enter. After scanning and correcting errors, restart the computer and check if the “system cannot find the file specified” error is fixed.
The Cleanup Rule clean: rm *.o prog3 This is an optional rule. It allows you to type 'make clean' at the command line to get rid of your object and executable files. Sometimes the compiler will link or compile files incorrectly and the only way to get a fresh start is to remove all the object and executable files.
A simple makefile consists of "rules" with the following shape: target ... : dependencies ... command ... ... A target is usually the name of a file that is generated by a program; examples of targets are executable or object files.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With