Skip to content

min-phony

Makefilesuspiciousno fixdefault: offmakefile/checkmake

Reports a target of the required option (default all, clean and test) that is not declared .PHONY, on the last .PHONY line, or on the last rule when there is none.

Conventional targets (all, clean, test) do not name files. If a file with that name appears, make considers the target up to date and does nothing.

To fix, add the target to .PHONY.

With this configuration:

min-phony:
level: warn
options:
required: [all, build]
Reported
.PHONY: all test
all:
test:
makefile:
lint:
rules:
min-phony:
level: warn # off (default), warn, error
options:
required: ["all","clean","test"]
Option Type Default Description
required list ["all","clean","test"] The targets every Makefile must declare .PHONY.

Enabled by the presets: makefile/checkmake.

Suppress one line with sudsy-disable-next-line min-phony in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
checkmake minphony full