Makefile: test if "dot" exists in "<pkg>-graph-depends"
authorFabio Porcedda <fabio.porcedda@gmail.com>
Tue, 17 Jun 2014 09:33:54 +0000 (11:33 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 22 Jun 2014 17:24:33 +0000 (19:24 +0200)
To be able to check the "dot" command availability in
"<pkg>-graph-depends" move the check to the "graph-depends-requirements" rule.
Also don't use a subshell for the exit command to be sure that the error
will be returned by the shell.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile
package/pkg-generic.mk

index 14fca2b3d529239b69229d823f7f6a1312970de3..4fe370abf391d206d6e3d9a4072e7e29fa6b0ef4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -673,9 +673,11 @@ graph-build: $(O)/build/build-time.log
                                   --output=$(O)/graphs/build.pie-$(t).$(BR_GRAPH_OUT) \
                                   $(if $(BR2_GRAPH_ALT),--alternate-colors)$(sep))
 
-graph-depends:
+graph-depends-requirements:
        @dot -? >/dev/null 2>&1 || \
-               (echo "ERROR: The 'dot' program from Graphviz is needed for graph-depends" >&2; exit 1)
+               { echo "ERROR: The 'dot' program from Graphviz is needed for graph-depends" >&2; exit 1; }
+
+graph-depends: graph-depends-requirements
        @$(INSTALL) -d $(O)/graphs
        @cd "$(CONFIG_DIR)"; \
        $(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
index 457d873660c6057a441f992f6e830050b598693b..4a011cceea37f0440b726c432f6a08d434597cda 100644 (file)
@@ -556,7 +556,7 @@ endif
 $(1)-show-depends:
                        @echo $$($(2)_FINAL_DEPENDENCIES)
 
-$(1)-graph-depends:
+$(1)-graph-depends: graph-depends-requirements
                        @$$(INSTALL) -d $$(O)/graphs
                        @cd "$$(CONFIG_DIR)"; \
                        $$(TOPDIR)/support/scripts/graph-depends -p $(1) $$(BR2_GRAPH_DEPS_OPTS) \