Skip to content

Instantly share code, notes, and snippets.

@farseerfc
Created November 20, 2019 06:56
Show Gist options
  • Save farseerfc/dd2360a1b948f79b9d4b490bef4cefbc to your computer and use it in GitHub Desktop.
Save farseerfc/dd2360a1b948f79b9d4b490bef4cefbc to your computer and use it in GitHub Desktop.
generate make-dag.svg for Makefile using makefile2graph
#!/bin/bash
set -x
# first invoke make to get a log of dependencies
LANG=C make -Bnd > make-dag.log
# run makefile2graph
cat make-dag.log | makefile2graph > make-dag.dot
sed "1a ranksep=5; nodesep=5;" -i make-dag.dot
twopi -Tsvg make-dag.dot -o make-dag.svg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment