Makefile Cheat Sheet/Silent recipes

Suppress command echoing globally or per line.

Section: Special targets and behavior control

Silent recipes

makefile
makefile
.SILENT:
# or prefix a line with @
Explanation

Silence all recipes or use `@command` for individual lines.

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 Special targets and behavior control
Declare multiple phony targets
Mark non-file targets explicitly.
OpenIn sheetmakefilesame section
Delete target on error
Remove a partially built target if the recipe fails.
OpenIn sheetmakefilesame section
One shell per recipe
Run all lines of a recipe in a single shell instance.
OpenIn sheetmakefilesame section
Secondary expansion
Allow a second variable expansion for prerequisites.
OpenIn sheetmakefilesame section
Disable parallelism
Force serial execution for all or selected targets.
OpenIn sheetmakefilesame section
Set explicit default goal
Choose which target runs when the user invokes plain `make`.
OpenIn sheetmakefile1 tag match