The error is ignored already by the leading '-
' on the command line. If you really want to lose the error messages from mkdir
, use I/O redirection:
bin:
-mkdir bin 2>&1
You will still get the 'ignored' warning from make
, though, so it might be better to use the option to mkdir
that doesn't cause it to fail when the target already exists, which is the -p
option:
MKDIR_P = mkdir -p
bin:
${MKDIR_P} $@
The -p
option actually creates all the directories that are missing on the given paths, so it can generate a a number of directories in one invocation, but a side-effect is that it does not generate an error for already existing directories. This does assume a POSIX-ish implementation of mkdir
; older machines may not support it (though it has been standard for a long time now).