2 # Copyright (C) 2009 The Android Open Source Project
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 products_pdf := $(OUT_DIR)/products.pdf
18 products_graph := $(products_pdf:%.pdf=%.dot)
21 @echo Product graph DOT: $@
24 echo 'graph [ ratio=.5 ];'; \
25 $(foreach p,$(ALL_PRODUCTS), \
26 $(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
27 echo \"$(d)\" -\> \"$(p)\";)) \
29 $(sort $(foreach p,$(ALL_PRODUCTS), \
30 $(foreach d,$(PRODUCTS.$(strip $(p)).INHERITS_FROM), \
32 $(foreach p,$(ALL_PRODUCTS),$(p))), \
33 echo \"$(prod)\" [ label=\"$(dir $(prod))\\n$(notdir $(prod))\"];) \
37 # This rule doesn't include any nodes that don't inherit from
38 # anything or don't have anything inherit from them, to make the
39 # graph more readable. To add that, add this line to the rule
41 # $(foreach p,$(ALL_PRODUCTS), echo \"$(p)\";) \
43 $(products_pdf): $(products_graph)
44 @echo Product graph PDF: $@
45 dot -Tpdf -Nshape=box -o $@ $<
47 product-graph: $(products_pdf)