Make "No rule to make target" in CI
Make was asked to build a file it has no recipe for and that does not exist on disk. A prerequisite - a source, header, or generated file - is missing or its path is wrong.
What this error means
The build stops with "No rule to make target X, needed by Y". Make found a dependency on X but neither a rule to build it nor an existing X file, so it cannot proceed.
make: *** No rule to make target 'src/config.h', needed by 'src/main.o'. Stop.Common causes
A prerequisite file is missing or mispathed
A header or source listed as a dependency does not exist at the path the Makefile expects - often a generated file, a renamed file, or one excluded by a partial checkout.
A generated file was never produced
The target depends on a file that an earlier codegen/configure step should have created (e.g. config.h from ./configure). If that step was skipped, the prerequisite is absent.
How to fix it
Run the step that generates the prerequisite
If the missing file is generated, run the generator/configure step before make.
./configure # produces config.h, Makefile fragments, etc.
makeFix the path or check out the missing file
- Confirm the prerequisite exists:
ls src/config.h. - If it is tracked, ensure a full checkout (and submodules) brought it in.
- If the path is wrong in the Makefile, correct the dependency or the variable that builds it.
How to prevent it
- Run
configure/codegen beforemakein CI, in that order. - Use a full checkout with submodules so all sources are present.
- Keep generated-file paths in sync with the Makefile when files move.