summaryrefslogtreecommitdiffstats
path: root/core/tasks/product-graph.mk
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-08-08 12:14:37 -0700
committerJoe Onorato <joeo@android.com>2009-08-08 12:15:10 -0700
commit3366c07e56cdb6ad7b1184388b5f25cf819de579 (patch)
tree80ffe22c0a53a5eea7fd8944f27d0d5db0513cb1 /core/tasks/product-graph.mk
parent630b7d3ffaac72873f5b91e7e215daa9c2818935 (diff)
downloadbuild-3366c07e56cdb6ad7b1184388b5f25cf819de579.zip
build-3366c07e56cdb6ad7b1184388b5f25cf819de579.tar.gz
build-3366c07e56cdb6ad7b1184388b5f25cf819de579.tar.bz2
Tweak the product graph formatting.
Diffstat (limited to 'core/tasks/product-graph.mk')
-rw-r--r--core/tasks/product-graph.mk30
1 files changed, 21 insertions, 9 deletions
diff --git a/core/tasks/product-graph.mk b/core/tasks/product-graph.mk
index 5dc13a6..6442252 100644
--- a/core/tasks/product-graph.mk
+++ b/core/tasks/product-graph.mk
@@ -15,22 +15,34 @@
#
products_pdf := $(OUT_DIR)/products.pdf
+products_graph := $(products_pdf:%.pdf=%.dot)
-# This rule doens't include any nodes that don't inherit from
-# anything or don't have anything inherit from them, to make the
-# graph more readable. To add that, add this line to the rule
-# below:
-# $(foreach p,$(ALL_PRODUCTS), echo \"$(p)\";) \
-
-$(products_pdf):
+$(products_graph):
+ @echo Product graph DOT: $@
$(hide) ( \
echo 'digraph {'; \
- echo 'graph [ ratio = .6, pack=false];'; \
+ echo 'graph [ ratio=.5 ];'; \
$(foreach p,$(ALL_PRODUCTS), \
$(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
echo \"$(d)\" -\> \"$(p)\";)) \
+ $(foreach prod, \
+ $(sort $(foreach p,$(ALL_PRODUCTS), \
+ $(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
+ $(d))) \
+ $(foreach p,$(ALL_PRODUCTS),$(p))), \
+ echo \"$(prod)\" [ label=\"$(dir $(prod))\\n$(notdir $(prod))\"];) \
echo '}' \
- ) | dot -Tpdf -Nshape=box -o $@
+ ) > $@
+
+# This rule doesn't include any nodes that don't inherit from
+# anything or don't have anything inherit from them, to make the
+# graph more readable. To add that, add this line to the rule
+# below:
+# $(foreach p,$(ALL_PRODUCTS), echo \"$(p)\";) \
+
+$(products_pdf): $(products_graph)
+ @echo Product graph PDF: $@
+ dot -Tpdf -Nshape=box -o $@ $<
product-graph: $(products_pdf)