Makefile Cheat Sheet/Warn on undefined variables

Emit warnings when undefined variables are expanded.

Section: Core make commands

Warn on undefined variables

bash
bash
make --warn-undefined-variables
Explanation

Very useful in large makefiles with many variables.

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 Core make commands
Dry run
Print commands without executing them.
OpenIn sheetbashsame section
Trace recursive directories
Show enter/leave directory messages.
OpenIn sheetbashsame section
Enable debug output
Print internal decision-making details.
OpenIn sheetbashsame section
Print database
Dump parsed rules and variables.
OpenIn sheetbashsame section
Run default target
Run make using the default makefile and first target.
OpenIn sheetbashsame section
Build a specific target
Run a named target from the makefile.
OpenIn sheetbashsame section