unique-targets
What it does
Section titled “What it does”Reports a target defined by more than one rule, which merges prerequisites and overrides recipes. Double-colon rules, .PHONY and the targets of the ignore option are not reported.
Why it matters
Section titled “Why it matters”Several rules for one target add their prerequisites and only one of them may have a recipe; make uses the last and warns about the override. The recipe that runs depends on the order of the rules.
To fix, merge the rules, or rename a target.
Example
Section titled “Example”a: echoa: echob::b::.PHONY: a.PHONY: b...d:Configuration
Section titled “Configuration”makefile: lint: rules: unique-targets: level: warn # off (default), warn, error options: ignore: []| Option | Type | Default | Description |
|---|---|---|---|
ignore |
list | [] |
Targets that may be defined more than once. |
Enabled by the presets: makefile/checkmake.
Suppress one line with sudsy-disable-next-line unique-targets 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 | uniquetargets |
full |