Skip to content

phony-declared

Makefilesuspiciousno fixdefault: offmakefile/checkmake

Reports a target with no recipe that is not declared .PHONY. Targets that start with a . are special and are not reported.

A target without a recipe that is not a file only groups other targets. If a file of that name appears, make stops running it, so the behaviour of the Makefile depends on what is in the directory.

To fix, add the target to .PHONY.

Reported
...
build:
echo
.DEFAULT: ;
empty: all
both one two:
$(OBJS): ;
makefile:
lint:
rules:
phony-declared: warn # off (default), warn, error

Enabled by the presets: makefile/checkmake.

Suppress one line with sudsy-disable-next-line phony-declared 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 phonydeclared full