Use bash with strict flags for recipes.
Section: Defensive recipes
Set shell and flags
makefile
makefile
SHELL := /usr/bin/env bash
.SHELLFLAGS := -eu -o pipefail -cExplanation
GNU make allows explicit shell configuration.
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 Defensive recipes
Use strict flags inside one-shell recipe
Fail fast in multi-line recipes.
Guard required variables
Abort early when a required variable is missing.
Respect jobserver in recursive make
Propagate parallelism automatically using `$(MAKE)`.
Synchronized parallel output
Keep log lines grouped by target when running with jobs.