Answer the question
In order to leave comments, you need to log in
How to create a directory in make?
The original makefile looked like this:
install:
mkdir "/usr/local/bin/myprogram/"
cp ./src/myprogram /usr/local/bin/myprogram/
...
sudo make install
mkdir "/usr/local/bin/myprogram/"
mkdir: невозможно создать каталог «/usr/local/bin/myprogram/»: Файл существует
makefile:2: recipe for target 'install' failed
make: *** [install] Error 1
Answer the question
In order to leave comments, you need to log in
Put a minus before mkdir (and before cp too).
make analyzes the return code of each executed command individually, if the command ends with a return code not equal to 0 (usually a sign of an error when the program is running), then make by default terminates the build process with an error. The minus sign causes make to ignore the return code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question