min-phony
What it does
Section titled “What it does”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.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”With this configuration:
min-phony: level: warn options: required: [all, build].PHONY: all testall:test:Configuration
Section titled “Configuration”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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| checkmake | minphony |
full |