I am using a makefile to run tests. I am not sure about the use of .PHONY. I've read this post: What is the purpose of .PHONY in a makefile?, but still I'm not sure.
I have the following makefile:
```
test:
@# Clear console log before we start.
@clear
# Make sure we are not having too much modules.
@npm prune
# Make sure we have the required modules.
@npm install
@# Clear the console, so we only see the test results.
@clear
# Run the test.
@./node_modules/.bin/mocha-casperjs test.js --reporter=spec
```
My make test command isn't making any new files. Should I be using the .PHONY: test or not? But even more important, why? (or why not?)
Thank you!
Malcolm Kindermans
Thanks to @Wintermute I got the answer to my question. He commented:
If you removed the tab before them, they'd not show up either -- then they'd be make comments instead of shell comments. Anyway, this question seems to be answered quite extensively behind the link you posted. test should be phony so that touch test; make test doesn't claim that test is up to date. What exactly is still unclear?
So the answer is: "Yes, I need to add test to the .PHONY, because executing the command touch test would break this make command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With