#!/bin/bash echo " digraph { rankdir=LR" for src in $@; do # do not include test cases (it makes the graph to dense) if ! echo $src | grep -q test; then # only display nodes which use another file (or are used) # if [ -n "$(grep '#include \"' $src | grep -v '/')" ]; then echo $(echo $src|tr .- __) ' [label=" '$src' "]' grep '#include "' $src | grep -v '/' | sed 's/^.*"\([^"]*\)"$/'$src' #> \1/' | tr '#.-' '-__' # fi fi done echo "}"