Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

fix(core): stop reading Makefile assignments with a colon as targets

DrDLyuan97a4ea3433c0
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index 8ad6178a..f82c98c8 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "understand-anything",
"description": "AI-powered codebase understanding — analyze, visualize, and explain any project",
- "version": "2.9.7",
+ "version": "2.9.8",
"author": {
"name": "Egonex"
},
diff --git a/.copilot-plugin/plugin.json b/.copilot-plugin/plugin.json
index 12f4ec02..dfcf1459 100644
--- a/.copilot-plugin/plugin.json
+++ b/.copilot-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "understand-anything",
"description": "AI-powered codebase understanding — analyze, visualize, and explain any project",
- "version": "2.9.7",
+ "version": "2.9.8",
"author": {
"name": "Egonex"
},
diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json
index 6fb445d8..35fb90c2 100644
--- a/.cursor-plugin/plugin.json
+++ b/.cursor-plugin/plugin.json
@@ -2,7 +2,7 @@
"name": "understand-anything",
"displayName": "Understand Anything",
"description": "AI-powered codebase understanding — analyze, visualize, and explain any project",
- "version": "2.9.7",
+ "version": "2.9.8",
"author": {
"name": "Egonex"
},
diff --git a/understand-anything-plugin/.claude-plugin/plugin.json b/understand-anything-plugin/.claude-plugin/plugin.json
index 8ad6178a..f82c98c8 100644
--- a/understand-anything-plugin/.claude-plugin/plugin.json
+++ b/understand-anything-plugin/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "understand-anything",
"description": "AI-powered codebase understanding — analyze, visualize, and explain any project",
- "version": "2.9.7",
+ "version": "2.9.8",
"author": {
"name": "Egonex"
},
diff --git a/understand-anything-plugin/package.json b/understand-anything-plugin/package.json
index c2ceb1d7..2ae1a076 100644
--- a/understand-anything-plugin/package.json
+++ b/understand-anything-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@understand-anything/skill",
- "version": "2.9.7",
+ "version": "2.9.8",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/understand-anything-plugin/packages/core/src/__tests__/parsers.test.ts b/understand-anything-plugin/packages/core/src/__tests__/parsers.test.ts
index 10d21420..d9dc3f1b 100644
--- a/understand-anything-plugin/packages/core/src/__tests__/parsers.test.ts
+++ b/understand-anything-plugin/packages/core/src/__tests__/parsers.test.ts
@@ -520,6 +520,20 @@ describe("MakefileParser edge cases", () => {
expect(targetNames).toContain("build");
expect(targetNames).toContain("test");
});
+
+ it("does not report a variable whose value contains a colon as a target", () => {
+ const content = [
+ "SRC = main.c util.c",
+ "OBJ = $(SRC:.c=.o)",
+ "URL = https://example.com/releases",
+ "export PATH = /usr/local/bin:$(PATH)",
+ "",
+ "build: $(OBJ)",
+ "\t$(CC) -o app $(OBJ)",
+ ].join("\n");
+ const result = parser.analyzeFile("Makefile", content);
+ expect(result.steps!.map(s => s.name)).toEqual(["build"]);
+ });
});
describe("ShellParser edge cases", () => {
diff --git a/understand-anything-plugin/packages/core/src/plugins/parsers/makefile-parser.ts b/understand-anything-plugin/packages/core/src/plugins/parsers/makefile-parser.ts
index 5b20139e..d62eafb3 100644
--- a/understand-anything-plugin/packages/core/src/plugins/parsers/makefile-parser.ts
+++ b/understand-anything-plugin/packages/core/src/plugins/parsers/makefile-parser.ts
@@ -26,7 +26,11 @@ export class MakefileParser implements AnalyzerPlugin {
for (let i = 0; i < lines.length; i++) {
// Match target: dependencies (not variable assignments or comments)
const match = lines[i].match(/^([a-zA-Z_.][a-zA-Z0-9_.-]*)(?:\s+.*)?:/);
- if (match && !lines[i].includes(":=") && !lines[i].includes("?=")) {
+ // An `=` before the first `:` makes the line an assignment whose value holds a colon
+ // (`OBJ = $(SRC:.c=.o)`, `URL = https://...`), not a rule.
+ const equals = lines[i].indexOf("=");
+ const isAssignment = equals !== -1 && equals < lines[i].indexOf(":");
+ if (match && !isAssignment && !lines[i].includes(":=") && !lines[i].includes("?=")) {
const name = match[1];
// Skip special Make targets (.PHONY, .DEFAULT, .SUFFIXES, etc.)
if (name.startsWith(".")) continue;
diff --git a/understand-anything-plugin/packages/viewer/package.json b/understand-anything-plugin/packages/viewer/package.json
index d23679ac..d7e4aa8f 100644
--- a/understand-anything-plugin/packages/viewer/package.json
+++ b/understand-anything-plugin/packages/viewer/package.json
@@ -1,6 +1,6 @@
{
"name": "understand-anything-viewer",
- "version": "2.9.7",
+ "version": "2.9.8",
"description": "Standalone read-only viewer for Understand-Anything knowledge graphs — no Claude Code or LLM required.",
"type": "module",
"license": "MIT",