graph-depends: support calling from recursive make
authorArnout Vandecappelle <arnout@mind.be>
Mon, 23 Jun 2014 20:11:23 +0000 (22:11 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 29 Jun 2014 08:43:37 +0000 (10:43 +0200)
The graph-depends script calls make. If the outer make was called
recursively, or if it was called with '-C <somedir>', then the
environment will contain "MAKEFLAGS=w --". Therefore, the recursive
make prints 'Entering' and 'Leaving' messages, which clobbers the
output for dot.

To avoid this, add "--no-print-directory" to the recursive make
arguments. Since we require GNU make 3.81, we can be sure that this
option is available.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
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>
support/scripts/graph-depends

index 58401a2fa157b6871095cdefe59b8b6827ef9800..52c16ceae3f8941c5234c8972018524bec3da1b5 100755 (executable)
@@ -81,7 +81,7 @@ allpkgs = []
 # list is used as the starting point for full dependency graphs
 def get_targets():
     sys.stderr.write("Getting targets\n")
-    cmd = ["make", "-s", "show-targets"]
+    cmd = ["make", "-s", "--no-print-directory", "show-targets"]
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
     output = p.communicate()[0].strip()
     if p.returncode != 0:
@@ -95,7 +95,7 @@ def get_targets():
 # dependencies formatted as a Python dictionary.
 def get_depends(pkgs):
     sys.stderr.write("Getting dependencies for %s\n" % pkgs)
-    cmd = ["make", "-s" ]
+    cmd = ["make", "-s", "--no-print-directory" ]
     for pkg in pkgs:
         cmd.append("%s-show-depends" % pkg)
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)