Am I wrong in my interpretation that I should basically just put first before all make rules:
.PHONY: all of my rules
all:
echo "Executing all ..."
of:
echo "Executing of ..."
my:
echo "Executing my ..."
rules:
echo "Executing rules ..."
Is there ever a case where you would not want to follow this 'formula'?
http://www.gnu.org/software/make/manual/make.html#Phony-Targets
Best Answer
Clark Grubb's Makefile style guide recommends that:
For your example, this would mean:
Multiple
PHONY
targets are allowed; see also this Stack Overflow question: "Is it possible to have multiple .PHONY targets in a gnu makefile?"Also, while this isn't mentioned directly in your question, care must be taken not to have a
PHONY
target with the same name of an actual input or intermediate files in your project. Eg, if your project hypothetically had a source code file namedrules
(with no suffix), the inclusion of that string in aPHONY
target could break expectedmake
behavior.