Skip to content

timestamp-expanded

Makefilesuspiciousno fixdefault: warnmakefile/checkmake

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.

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.

Reported
A = $(shell date +%s)
B := $(shell date +%s)
C ?= a date
D = date
E += $(shell date)
F ::= $(shell date)
G != date
foo: H = $(shell date)
makefile:
lint:
rules:
timestamp-expanded: warn # off, warn (default), error

Enabled by the presets: makefile/checkmake.

Suppress one line with sudsy-disable-next-line timestamp-expanded 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 timestampexpanded full