Skip to content

Instantly share code, notes, and snippets.

@wangkuiyi
Created May 8, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wangkuiyi/cae5260fb303d99ce7e6e9bf4fe6c8dd to your computer and use it in GitHub Desktop.
Save wangkuiyi/cae5260fb303d99ce7e6e9bf4fe6c8dd to your computer and use it in GitHub Desktop.
Plot Majel's package dependencies
for i in $(du -a | cut -f 2); do
if [[ -d $i ]]; then
echo === $i |
sed 's/\.//';
grep '#include <majel' $i/*.{h,cu,cc,cpp,hpp,hh} 2>/dev/null |
sed 's/^.*#include <majel//' |
sed 's/\/[-_a-z0-9]*.h>$//' |
sort |
uniq;
fi;
done |
sed -e 's/^$/\//' |
gawk '{ if ($1 == "===") { start=$2; if (start=="") start ="/"; } else { printf("\"%s\" -> \"%s\";\n", start, $1); } }' > /tmp/majel.dot
@wangkuiyi
Copy link
Author

majel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment