Skip to content
Latchkey

make "*** [target] Error 1" recipe failed in CI

A command inside a make recipe returned a non-zero exit code, and make reports it as "Error <code>". "Error 1" is the failing command's exit status, not a make bug; the real cause printed just above.

What this error means

make stops with "make: *** [Makefile:20: app] Error 1" after a compiler, linker, or shell command in the recipe failed.

make
g++ -c main.cpp -o main.o
main.cpp:5:10: fatal error: config.h: No such file or directory
make: *** [Makefile:20: main.o] Error 1

Common causes

A recipe command failed

The compiler, linker, or a shell step in the recipe exited non-zero; make surfaces that exit code.

A missing tool or input in the recipe

A command in the recipe references a tool or file absent on the runner, so it exits with an error.

How to fix it

Read the command output above the Error line

  1. Find the last command make ran before "Error 1".
  2. Read its actual error message (a compile error, missing header, or missing tool).
  3. Fix that command's cause, then re-run make.

Keep going to collect all failures

Use -k to see every failing recipe in one run instead of stopping at the first.

Terminal
make -k

How to prevent it

  • Treat "Error 1" as the exit code of the real failing command above it.
  • Install all tools the recipes invoke in a setup step.
  • Fail fast in recipes so the first real error is obvious.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →