GNU Make 4 · Variables and functions
List files and change extensions
Find source files, then derive object file names from them.
SRC := $(wildcard src/*.c)
OBJ := $(SRC:src/%.c=build/%.o)
Official GNU Make 4 documentation
More variables and functions commands
- Define variables
- Automatic variables
- 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