timestamp-expanded
What it does
Section titled “What it does”Reports a variable whose value runs date and that is not simply expanded (:=, ::=): every use runs date again and the values differ within one build.
Why it matters
Section titled “Why it matters”A recursively expanded variable (=) runs its text each time it is used, so a build that uses TS = $(shell date) twice gets two different times, and file names built from it do not match.
To fix, write TS := $(shell date +%s), which runs once.
Example
Section titled “Example”A = $(shell date +%s)B := $(shell date +%s)C ?= a dateD = dateE += $(shell date)F ::= $(shell date)G != datefoo: H = $(shell date)Configuration
Section titled “Configuration”makefile: lint: rules: timestamp-expanded: warn # off, warn (default), errorEnabled by the presets: makefile/checkmake.
Suppress one line with sudsy-disable-next-line timestamp-expanded 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 | timestampexpanded |
full |