make "No rule to make target" in CI
make needs a file to satisfy a dependency but that file does not exist and no rule tells make how to create it. The prerequisite was deleted, is in the wrong path, or a header/generated file is missing.
What this error means
make stops with "make: *** No rule to make target 'foo.h', needed by 'main.o'. Stop." naming a prerequisite it cannot produce or locate.
make: *** No rule to make target 'include/config.h', needed by 'main.o'. Stop.Common causes
A prerequisite file does not exist
A header or source listed as a dependency was deleted, renamed, or never checked out on the runner.
A generated file was not generated first
A file expected to be produced by an earlier step is missing because that step did not run in CI.
How to fix it
Restore or regenerate the prerequisite
- Confirm the named file exists at the path make expects.
- Restore a deleted file or run the generator step that produces it.
- For generated headers, run the generation target before the main build.
make generate-config
makeFix the path in the Makefile
If the file moved, update its path or the VPATH so make can find the prerequisite.
VPATH = include:srcHow to prevent it
- Check that all generated files are produced by an explicit target.
- Keep prerequisite paths in the Makefile in sync with the tree.
- Do clean builds so stale expectations do not persist.