A Lean 4 command-line tool that converts GNU Make's auto-generated database into Graphviz DOT format, with support for pruning and highlighting dependency lineage.
make_lineage parses the output of make -n -p (Make's printed database) and produces a DOT graph of target dependencies. It then offers three lineage operations relative to a given target:
| Operation | Flag | Description |
|---|---|---|
| Highlight | --highlight-lineage <target> |
Full graph is emitted; the lineage of <target> is highlighted |
| Keep | --keep-lineage <target> |
Only the lineage of <target> is emitted; all unrelated nodes are removed |
| Prune | --prune-lineage <target> |
The lineage of <target> is removed; everything else is kept |
Binary is in .lake/build/bin.
lake build -KreleaseHighlighting the lineage of common.h
LANG=C make -n -p -f res/Makefile | .lake/build/bin/ml --highlight-lineage common.h | dot -Tpng -o res/prune-common.pngKeeping only the lineage of common.h
LANG=C make -n -p -f res/Makefile | .lake/build/bin/ml --keep-lineage common.h | dot -Tpng -o res/prune-common.pngPruning the lineage of common.h
LANG=C make -n -p -f res/Makefile | .lake/build/bin/ml --prune-lineage common.h | dot -Tpng -o res/prune-common.png

