Expand to all prerequisites without duplicates.
Section: Automatic variables
$^ all prerequisites
makefile
makefile
app: main.o util.o
cc $^ -o $@Explanation
Great for linker commands.
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.
$* stem in pattern rules
Use the matched stem from the target pattern.
dir and notdir with automatic vars
Extract target directory or file name.
Update archive with newer objects
Use `$?` to add only changed prerequisites.