GNU Make 4 · Variables and functions
Use conditionals
Choose settings based on a variable.
ifeq ($(DEBUG),1)
CFLAGS += -g -O0
else
CFLAGS += -O2
endif
Official GNU Make 4 documentation
More variables and functions commands
- Define variables
- Automatic variables
- List files and change extensions
- Run a command and capture its output
- Include another makefile
- Pass variables to commands
All variables and functions commands · GNU Make 4 cheatsheet