Technology · PRACTICAL GUIDE
make says “No rule to make target”? Trace the missing node before rebuilding
The error names a missing dependency-graph node, not a universal fix. Capture the loaded makefiles, expanded name, file identity and rule search before cleaning or inventing a recipe.

The message names the first dependency-graph node that make could not find or build. Preserve that exact spelling, prove which makefiles and variables produced it, and fix one broken edge instead of deleting the entire build tree.
A target can fail because the requested goal is absent, a prerequisite file is missing, an expanded path is wrong, or no explicit or implicit rule can generate the node.
1. Freeze the first graph failure
Save the first complete diagnostic, including every recursive make level and the exact quoted names. Record pwd -P, the command line, make --version, MAKEFLAGS and relevant command-line assignments. Do not start with make clean: generated dependency files and the first failure order are evidence.
Classify the message before editing. If there is no “needed by” phrase, the command-line goal itself may be missing. If there is one, draw the single edge from the parent to the missing node and follow only that branch first.
2. Prove which makefiles and names were loaded
Use the implementation’s read-only database or debug output, such as GNU make -pn or an appropriately scoped debug flag, and capture the makefiles it reports reading. In recursive builds, also record each entering-directory line; a child make may run in a different tree with different variables.
Search the printed database and source makefiles for the exact missing string and its parent. Inspect command-line and environment overrides, includes, VPATH, generated fragments and configuration output. Show hidden bytes with a byte-aware tool when the name is blank or unexpectedly contains whitespace or carriage returns.
3. Test the filesystem object, not your memory
From the directory used by the failing make process, inspect the exact expanded pathname with stat, readlink and a case-sensitive directory listing. A broken symlink, renamed source, case change, uninitialized submodule or stale absolute library path can all look like one missing target to the graph.
If the node is supposed to be generated, identify the generator, its feature gate and the rule that declares its output. Do not create an empty placeholder merely to satisfy make: that can advance the build with invalid bytes and hide the producer that never ran.
4. Prove the rule-search boundary
Decide whether the node should already exist or should be buildable. For an existing source, repair the path or restore the reviewed file. For a generated node, prove an explicit rule, a valid pattern with a stem, or an applicable inference rule and all of its own prerequisites.
Treat literal percent signs, emptied variables, disabled shared-library options and generated Makefiles as separate branches. When another tool generated the build tree, fix its source configuration and regenerate rather than hand-editing disposable Makefiles.
5. Repair one edge and replay acceptance
Make the smallest justified change: correct one name, restore one source, enable the intended generator, update one declared dependency or regenerate from reviewed configuration. Preserve the old build metadata until the repaired trace identifies the expected rule path.
Re-run the original invocation from the same directory and environment. Accept only if the missing node is found or built by the intended rule, its immediate parent advances, and a second no-op or incremental run is stable. Save the before-and-after database excerpt, file identity and final artifact check.
