make Exit Code 2 in CI: Build Recipe Failures Explained
make exits 2 when a build recipe fails or it encounters a usage/rule error - the canonical "the build broke" code from make.
A step exiting 2 from make means make itself reported a failure. The real cause is the command inside the failing recipe, printed just above.
What it means
make uses exit 2 for errors: a recipe command exited non-zero, or there was a problem with the Makefile (missing target, syntax). Exit 1 only appears with -q (query mode). Exit 0 means success.
Common causes
- A compiler or shell command in a recipe failed.
- A missing target or prerequisite.
- A tab/whitespace or syntax error in the Makefile.
How to fix it
Find the make: *** [target] Error N line and read the command output above it - that failing command is the real cause. Re-run with make -d for rule-level detail if needed.
Related guides
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
CI Exit Code Lookup: What Does This Exit Code Mean?Instant lookup for CI/CD process exit codes - enter a code (137, 127, 143…) to see what it means, whether it…