Makefile Debugging, Parallelism & CI/Use strict flags inside one-shell recipe

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-bucket
Explanation

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
Set shell and flags
Use bash with strict flags for recipes.
OpenIn sheetmakefilesame section
Guard required variables
Abort early when a required variable is missing.
OpenIn sheetmakefilesame section
Trace target execution
Show when each target is considered and updated.
Respect jobserver in recursive make
Propagate parallelism automatically using `$(MAKE)`.
OpenIn sheetmakefile
Full debug output
Print broad internal diagnostics.
Synchronized parallel output
Keep log lines grouped by target when running with jobs.