aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/bintool.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-09-21 08:22:11 -0400
committerTom Rini <trini@konsulko.com>2022-09-21 08:22:11 -0400
commit179a9320c0a258fba0736fe16fd90d1cee8fc223 (patch)
tree7be6ac03626f5f167850ec389e004558afff4c98 /tools/binman/bintool.py
parent12ed6d4911ced1df099a365e0a994b54211b60f3 (diff)
parentd64af08f19132c85422b442657920f4024b5caf7 (diff)
Merge tag 'dm-pull-21sep22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Fix futility bintool to run on newer distros Apply a lost patch
Diffstat (limited to 'tools/binman/bintool.py')
-rw-r--r--tools/binman/bintool.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py
index 032179a99d..a582d9d344 100644
--- a/tools/binman/bintool.py
+++ b/tools/binman/bintool.py
@@ -319,7 +319,7 @@ class Bintool:
return result.stdout
@classmethod
- def build_from_git(cls, git_repo, make_target, bintool_path):
+ def build_from_git(cls, git_repo, make_target, bintool_path, flags=None):
"""Build a bintool from a git repo
This clones the repo in a temporary directory, builds it with 'make',
@@ -330,6 +330,7 @@ class Bintool:
make_target (str): Target to pass to 'make' to build the tool
bintool_path (str): Relative path of the tool in the repo, after
build is complete
+ flags (list of str): Flags or variables to pass to make, or None
Returns:
tuple:
@@ -341,8 +342,11 @@ class Bintool:
print(f"- clone git repo '{git_repo}' to '{tmpdir}'")
tools.run('git', 'clone', '--depth', '1', git_repo, tmpdir)
print(f"- build target '{make_target}'")
- tools.run('make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
- make_target)
+ cmd = ['make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
+ make_target]
+ if flags:
+ cmd += flags
+ tools.run(*cmd)
fname = os.path.join(tmpdir, bintool_path)
if not os.path.exists(fname):
print(f"- File '{fname}' was not produced")