target: dependencies
command1
command2
On my system (Mac OS X), make
seems to require that that Makefiles have a tab character
Until GNU Make 4.2
Steven Penny's answer works.
.RECIPEPREFIX +=
The reason why this works is described in my comment.
Since GNU Make 4.3 (released on 19 Jan 2020)
Behavior of +=
operator has been changed in a backward-incompatible way. If the left operand has an empty value, a space is no longer added.
You can instead use
.RECIPEPREFIX := $(.RECIPEPREFIX)
, where
is a single space. Although $(.RECIPEPREFIX)
is expanded as an empty value, this is needed not to let GNU Make ignore
. Note this code works even on GNU Make older than version 4.3.