Is it possible to have multiple .PHONY targets in a GNU makefile?
MakefileGnu MakeMakefile Problem Overview
For various reasons, it would be convenient for me to specify .PHONY in multiple parts of a makefile. I feel like I'm not correctly understanding how this works, but is this possible?
Instead of .PHONY: clean cleanall
do:
.PHONY: clean
<some text>
.PHONY: cleanall
Makefile Solutions
Solution 1 - Makefile
Yes, that's allowed. (If you don't believe me, just try it!)
Solution 2 - Makefile
PHONY=
PHONY+= clean
...
PHONY+= cleanall
.PHONY : $(PHONY)