You got quite complex example I think. It has many things in it.
Rule / Recipe
A: B
<command>
A
- targetB
- dependency<command>
- command to be executed to buildA
("Recipe")
target: dependency
is called a 'rule'.
So all in all, above example is 'rule' with appropriate 'recipe'.
(to make A
, which depends on B
, one needs to execute <command>
)
make
compares modifications dates of B
and A
. If B
is newer, then it executes <command>
Variables
$(IREJECTION)
is make
's variable (it should be defined somewhere before in the file, like IREJECTION:=somefile.o
)
During make
execution $(IREJECTION)
is replaced to actual value of the variable.
Variable substitution
From link below:
$(var:a=b)
<..> take the value of the variable var
, replace every 'a' at the end of a word with 'b' in that value, and substitute the resulting string.
And:
For example:
foo := a.o b.o c.o
bar := $(foo:%.o=%.c)
sets bar
to a.c b.c c.c
.
In your case $(IREJECTION:%$(MACH64).o=%.cpp)
, it takes variable named IREJECTION
, tries to find $(MACH64).o
(which also references variable MACH64
) at the end of the word and replace it with .cpp
.
Automatic variable
$@
is called automatic variable.
It is reference to the 'target'.