I have a makefile that is using %.target. I am wondering how I could add those to .PHONY.
Simplified, this might look like this.
%.build:
docker build -t $* .
>Solution :
It’s not exactly clear what you want to do but if what you want is for any command line goal that matches the pattern %.build to be treated as phony you can add this to your makefile:
.PHONY: $(filter %.build,$(MAKECMDGOALS))