Add more colors to generated product graphs

Color the node nodes by their location to:
- /build/make/target/product/* => light yellow
- /vendor/* => light red

Test: m product-graph
Change-Id: I911764352e7dc4e2ead2b3770300f48d23dc20b8
This commit is contained in:
Anton Hansson 2019-05-16 11:09:57 +01:00
parent 87c470e127
commit 6ea18292dc
1 changed files with 15 additions and 1 deletions

View File

@ -52,13 +52,27 @@ all_products := $(call gather-all-products)
open_parethesis := (
close_parenthesis := )
node_color_target := orange
node_color_common := beige
node_color_vendor := lavenderblush
node_color_default := white
define node-color
$(if $(filter $(1),$(PRIVATE_PRODUCTS_FILTER)),\
$(node_color_target),\
$(if $(filter build/make/target/product/%,$(1)),\
$(node_color_common),\
$(if $(filter vendor/%,$(1)),$(node_color_vendor),$(node_color_default))\
)\
)
endef
# Emit properties of a product node to a file.
# $(1) the product
# $(2) the output file
define emit-product-node-props
$(hide) echo \"$(1)\" [ \
label=\"$(dir $(1))\\n$(notdir $(1))\\n\\n$(subst $(close_parenthesis),,$(subst $(open_parethesis),,$(PRODUCTS.$(strip $(1)).PRODUCT_MODEL)))\\n$(PRODUCTS.$(strip $(1)).PRODUCT_DEVICE)\" \
$(if $(filter $(1),$(PRIVATE_PRODUCTS_FILTER)), style=\"filled\" fillcolor=\"#FFFDB0\",) \
style=\"filled\" fillcolor=\"$(strip $(call node-color,$(1)))\" \
colorscheme=\"svg\" fontcolor=\"darkblue\" href=\"products/$(1).html\" \
] >> $(2)