diff options
author | Tom Rini <trini@konsulko.com> | 2022-09-26 11:27:30 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-26 11:27:30 -0400 |
commit | ffa2c88bcf8618b6d6fb71f5263beede9a179b20 (patch) | |
tree | 750fa5677f89e5b7b48d1510cba9978a2b13b15e /tools/binman/bintool.py | |
parent | 9114b7cee817789ad59e0fb6d5cd57f50668b4e1 (diff) | |
parent | 3c1ec13317292933fd01d9c60aae3ff1d5bc171e (diff) |
Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv into next
Diffstat (limited to 'tools/binman/bintool.py')
-rw-r--r-- | tools/binman/bintool.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py index 032179a99de..a582d9d3446 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") |