core/graph-depends: add option to graph reverse dependencies

Now that we can dump the reverse dependencies of a package, add the
ability to graph those.

It does not make sense to do a full reverse graph, as it would be
semantically equivalent to the direct graph. So we only provide a
per-package reverse graph.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Yann E. MORIN
2016-10-23 19:19:44 +02:00
committed by Thomas Petazzoni
parent f33fcdf225
commit 2a2eb55ca7
3 changed files with 32 additions and 10 deletions

View File

@@ -317,6 +317,16 @@ be selected at a time. Please fix your configuration)
endif
endef
define pkg-graph-depends
@$$(INSTALL) -d $$(GRAPHS_DIR)
@cd "$$(CONFIG_DIR)"; \
$$(TOPDIR)/support/scripts/graph-depends $$(BR2_GRAPH_DEPS_OPTS) \
-p $(1) $(2) -o $$(GRAPHS_DIR)/$$(@).dot
dot $$(BR2_GRAPH_DOT_OPTS) -T$$(BR_GRAPH_OUT) \
-o $$(GRAPHS_DIR)/$$(@).$$(BR_GRAPH_OUT) \
$$(GRAPHS_DIR)/$$(@).dot
endef
################################################################################
# inner-generic-package -- generates the make targets needed to build a
# generic package
@@ -702,13 +712,10 @@ $(1)-show-rdepends:
@echo $$($(2)_RDEPENDENCIES)
$(1)-graph-depends: graph-depends-requirements
@$$(INSTALL) -d $$(GRAPHS_DIR)
@cd "$$(CONFIG_DIR)"; \
$$(TOPDIR)/support/scripts/graph-depends $$(BR2_GRAPH_DEPS_OPTS) \
-p $(1) -o $$(GRAPHS_DIR)/$$(@).dot
dot $$(BR2_GRAPH_DOT_OPTS) -T$$(BR_GRAPH_OUT) \
-o $$(GRAPHS_DIR)/$$(@).$$(BR_GRAPH_OUT) \
$$(GRAPHS_DIR)/$$(@).dot
$(call pkg-graph-depends,$(1),--direct)
$(1)-graph-rdepends: graph-depends-requirements
$(call pkg-graph-depends,$(1),--reverse)
$(1)-all-source: $(1)-source
$(1)-all-source: $$(foreach p,$$($(2)_FINAL_ALL_DEPENDENCIES),$$(p)-all-source)