[U-Boot] [PATCH v2 3/3] buildman: make sure to invoke GNU Make

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Jul 22 04:19:09 CEST 2014


Since the command name 'make' may not be GNU Make on some platforms
such as FreeBSD, buildman should call scripts/show-gnu-make to get
the command name for GNU MAKE (and error out if it is not found).

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
Acked-by: Simon Glass <sjg at chromium.org>
Tested-by: Jeroen Hofstee <jeroen at myspectrum.nl>
---

Changes in v2:
  - Check GNU Make only once at startup.
    It seems more reasonable because buildman generally invokes
    make over and over again.

 tools/buildman/builder.py | 6 ++++--
 tools/buildman/control.py | 9 ++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 4a2d753..4987fc9 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -546,7 +546,7 @@ class Builder:
             self.func_sizes = func_sizes
 
     def __init__(self, toolchains, base_dir, git_dir, num_threads, num_jobs,
-                 checkout=True, show_unknown=True, step=1):
+                 gnu_make='make', checkout=True, show_unknown=True, step=1):
         """Create a new Builder object
 
         Args:
@@ -555,6 +555,7 @@ class Builder:
             git_dir: Git directory containing source repository
             num_threads: Number of builder threads to run
             num_jobs: Number of jobs to run at once (passed to make as -j)
+            gnu_make: the command name of GNU Make.
             checkout: True to check out source, False to skip that step.
                 This is used for testing.
             show_unknown: Show unknown boards (those not built) in summary
@@ -566,6 +567,7 @@ class Builder:
         self.threads = []
         self.active = True
         self.do_make = self.Make
+        self.gnu_make = gnu_make
         self.checkout = checkout
         self.num_threads = num_threads
         self.num_jobs = num_jobs
@@ -667,7 +669,7 @@ class Builder:
             args: Arguments to pass to make
             kwargs: Arguments to pass to command.RunPipe()
         """
-        cmd = ['make'] + list(args)
+        cmd = [self.gnu_make] + list(args)
         result = command.RunPipe([cmd], capture=True, capture_stderr=True,
                 cwd=cwd, raise_on_error=False, **kwargs)
         return result
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index d2f4102..fd6f197 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -14,6 +14,7 @@ import gitutil
 import patchstream
 import terminal
 import toolchain
+import command
 
 def GetPlural(count):
     """Returns a plural 's' if count is not 1"""
@@ -144,10 +145,16 @@ def DoBuildman(options, args):
     if not options.step:
         options.step = len(series.commits) - 1
 
+    gnu_make = command.Output(os.path.join(options.git,
+                                           'scripts/show-gnu-make')).rstrip()
+    if not gnu_make:
+        print >> sys.stderr, 'GNU Make not found'
+        sys.exit(1)
+
     # Create a new builder with the selected options
     output_dir = os.path.join(options.output_dir, options.branch)
     builder = Builder(toolchains, output_dir, options.git_dir,
-            options.threads, options.jobs, checkout=True,
+            options.threads, options.jobs, gnu_make=gnu_make, checkout=True,
             show_unknown=options.show_unknown, step=options.step)
     builder.force_config_on_failure = not options.quick
 
-- 
1.9.1



More information about the U-Boot mailing list