I'm reading a big Makefile, part of which I don't understand:
$(IREJECTION): $(IREJECTION:%$(MACH64).o=%.cpp)
$(CPP) $(CPPDLIBOPTS) -c $(@:%$(MACH64).o=%.cpp) -o $@
In this script (note that I removed unnecessary variables to avoid verbosity), what does the following mean
$(IREJECTION:%$(MACH64).o=%.cpp)(on the first line)$(@:%$(MACH64).o=%.cpp)? (on the second line)
Also, what does this form A: B mean? As in :
$(IREJECTION): $(IREJECTION:%$(MACH64).o=%.cpp) #on the first line
<---- A ----> <------------ B ---------------> #first instance of A: B
<--- A ----> <-------- B ------> #second instance of A: B
As you see, there are two instances of the form A:B — the second one is inside B itself. I see similar thing here as well:
$(@:%$(MACH64).o=%.cpp) #on the second line
<A> <---------B------->
Please help me understand this.
$(var:%.foo=%.bar)means replace.fooextensions of all elements ofvarwith.bar.barextensions of all elements ofvarwith.foo?%$(MACH64).o=%.cpp,.cppfiles are being generated from.ofiles?