From 81d1040226823792d61c35d1f6cd93a408db3b45 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Sat, 27 Aug 2011 22:41:43 +0000 Subject: [PATCH] Add graph option for callgraph --- etc/Makefile | 2 +- etc/graphdeps.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/Makefile b/etc/Makefile index 4bee0f0..adc04df 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -59,7 +59,7 @@ appcallgraph: $(APPCALLGRAPH) ./graphdeps.py $< --out $@ --showops ../%/callgraph.pdf: ../%/callgraph.d - (cd $(dir $@); ../../etc/graphdeps.py $(notdir $<) --out $(notdir $@)) + (cd $(dir $@); ../../etc/graphdeps.py --calls $(notdir $<) --out $(notdir $@)) ../%/files.d: ../%/Makefile (cd $(dir $@); ../../etc/makemake.py --relpath --files . . ../../drivers ../../drivers/avr ../../utils --exclude system.h > files.d) diff --git a/etc/graphdeps.py b/etc/graphdeps.py index 475efe7..2df457d 100755 --- a/etc/graphdeps.py +++ b/etc/graphdeps.py @@ -61,6 +61,10 @@ def node_output (dotfile, name, options): colour = 'orange' shape = 'rectangle' + if options.calls: + colour = 'magenta' + shape = 'rectangle' + dotfile.write ('\t"' + name + '"\t [style=filled,shape=' + shape + ',color=' + colour + '];\n') return name @@ -145,6 +149,10 @@ def main(argv = None): dest = 'modules', default = False, 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', dest = 'fullpaths', default = False, help = 'show full paths')