Add graph option for callgraph

This commit is contained in:
Michael Hayes
2011-08-27 22:41:43 +00:00
parent 0ea62d5d8e
commit 81d1040226
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ appcallgraph: $(APPCALLGRAPH)
./graphdeps.py $< --out $@ --showops ./graphdeps.py $< --out $@ --showops
../%/callgraph.pdf: ../%/callgraph.d ../%/callgraph.pdf: ../%/callgraph.d
(cd $(dir $@); ../../etc/graphdeps.py $(notdir $<) --out $(notdir $@)) (cd $(dir $@); ../../etc/graphdeps.py --calls $(notdir $<) --out $(notdir $@))
../%/files.d: ../%/Makefile ../%/files.d: ../%/Makefile
(cd $(dir $@); ../../etc/makemake.py --relpath --files . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > files.d) (cd $(dir $@); ../../etc/makemake.py --relpath --files . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > files.d)
+8
View File
@@ -61,6 +61,10 @@ def node_output (dotfile, name, options):
colour = 'orange' colour = 'orange'
shape = 'rectangle' shape = 'rectangle'
if options.calls:
colour = 'magenta'
shape = 'rectangle'
dotfile.write ('\t"' + name + '"\t [style=filled,shape=' + shape + ',color=' + colour + '];\n') dotfile.write ('\t"' + name + '"\t [style=filled,shape=' + shape + ',color=' + colour + '];\n')
return name return name
@@ -145,6 +149,10 @@ def main(argv = None):
dest = 'modules', default = False, dest = 'modules', default = False,
help = 'show module dependencies') help = 'show module dependencies')
parser.add_option('--calls', action = 'store_true',
dest = 'calls', default = False,
help = 'show callgraph')
parser.add_option('--fullpaths', action = 'store_true', parser.add_option('--fullpaths', action = 'store_true',
dest = 'fullpaths', default = False, dest = 'fullpaths', default = False,
help = 'show full paths') help = 'show full paths')