Revision [16133]

This is an old revision of CDependencyGraph made by ToBo on 2013-03-30 02:32:28.

 

Abhängigkeitsgraph der C-Module mit graphviz erstellen



1. Result




2. Script


#!/bin/bash
# Author: Andreas Tobola
# http://www.tnotes.de/CDependencyGraph
FILE_OUT="rat2src.dot"
echo "digraph G {" > $FILE_OUT
echo "rankdir=LR;" >> $FILE_OUT
echo "fontsize=24;" >> $FILE_OUT
for mfile in `ls ./rat2src`
do
  module=`echo $mfile | sed 's/[.]/ /' | awk '{print $1}'`
  echo $module" ("$mfile")"
  modlist=`cat ./rat2src/$mfile | grep -v '<' |  grep '#include'| awk '{print $2}'  | sed 's/<//g'  | sed 's/>//g' | sed 's/[.]/ /g' | sed 's/"//g' | awk '{print $1}' | grep -v $module`
  for link in $modlist
  do
     echo "   "$link
     echo "\""$module"\" -> \""$link"\"" >> $FILE_OUT
  done
done
echo "}" >> $FILE_OUT
echo "graphviz..."
dot -Tpng $FILE_OUT  -o rat2moddep.png
echo "create small picture..."
convert -resize 50%x50% rat2moddep.png rat2modddep_s.png



Siehe auch
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki