Simply put I want to give a name to a rule in my Makefile:
A.ext : B.ext
compute A.ext from B.ext
so that I get something like this:
.PHONY : my_rule
A.ext : my_rule
my_rule : B.ext
compute A.ext from B.ext
But this is not yet equivalent to the first, since my_rule
is always executed even if B.ext hasn't changed. How can I achieve equivalence?
This is the trimmed output of make -d
:
Considering target file `A.ext'.
Considering target file `my_rule'.
File `my_rule' does not exist.
Considering target file `B.ext'.
Finished prerequisites of target file `B.ext'.
No need to remake target `B.ext'.
Finished prerequisites of target file `my_rule'.
Must remake target `my_rule'.
(The reason I want this is that I have another rule C.ext :| my_rule
.)