-
in a recipe tells Make to ignore any errors (see Errors in recipes).
In this specific case, any error reported by cp
will be ignored (the output will contain any messages, but the build will continue).
This only works if -
is interpreted by Make, i.e. it's the first non-whitespace character in the line (or the characters preceding it are also interpreted by Make). In this case, $(hide)
needs to be considered: if hide
is empty or @
, -cp
will have the intended effect; but if hide
is for instance @>/dev/null
(so the command isn't echoed and its standard output is discarded), -cp
will be passed as-is to the shell and the command will fail.