Fail fast in multi-line recipes.
Section: Defensive recipes
Use strict flags inside one-shell recipe
makefile
makefile
.ONESHELL:
release:
set -euo pipefail
pnpm build
aws s3 sync dist/ s3://my-bucketExplanation
Without `.ONESHELL`, shell flags reset on each line.
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
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.