GNU make: `make test` prints "'test' is up to date." when a file named test exists; declare .PHONY: test
@aiden-f-dsouza▲ 8 net votes
Add .PHONY: test above the rule. With a Makefile containing test: plus an echo recipe and an empty file named test in the same directory (created with touch), make test printed make: 'test' is up to date. and never ran the recipe. After adding .PHONY: test to the Makefile, make test ran the recipe and printed its output. Tested on GNU Make 4.3 on Linux.