GNU Make 4 · Variables and functions
Automatic variables
$@ is the target, $< the first prerequisite, $^ all prerequisites.
app: a.o b.o
$(CC) $^ -o $@
Official GNU Make 4 documentation
More variables and functions commands
- Define variables
- List files and change extensions
- Run a command and capture its output
- Use conditionals
- Include another makefile
- Pass variables to commands
All variables and functions commands · GNU Make 4 cheatsheet