Use the matched stem from the target pattern.
Section: Automatic variables
$* stem in pattern rules
makefile
makefile
build/%.min.js: src/%.js
terser $< -o build/$*.min.jsExplanation
`$*` is mostly for pattern and suffix rules.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Automatic variables
$? newer prerequisites
Expand to prerequisites newer than the target.
dir and notdir with automatic vars
Extract target directory or file name.