diff options
| author | Nick Brassel <nick@tzarc.org> | 2023-03-29 21:26:05 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 21:26:05 +1100 |
| commit | 5bb8f7ae84a7de060d6b04bfa875c6a922777116 (patch) | |
| tree | 29bea1ea069c8a1a6368316984e280e003ecc51d /lib/python/qmk/cli | |
| parent | d31d1488e8e72a7e8542edd36f335c7d146b1f97 (diff) | |
Add ability for `qmk mass-compile` to build specified targets (#20294)
Diffstat (limited to 'lib/python/qmk/cli')
| -rwxr-xr-x | lib/python/qmk/cli/mass_compile.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/mass_compile.py b/lib/python/qmk/cli/mass_compile.py index 941e6aa411..909118790c 100755 --- a/lib/python/qmk/cli/mass_compile.py +++ b/lib/python/qmk/cli/mass_compile.py | |||
| @@ -12,6 +12,7 @@ from qmk.commands import _find_make, get_make_parallel_args | |||
| 12 | from qmk.search import search_keymap_targets | 12 | from qmk.search import search_keymap_targets |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | @cli.argument('builds', nargs='*', arg_only=True, help="List of builds in form <keyboard>:<keymap> to compile in parallel. Specifying this overrides all other target search options.") | ||
| 15 | @cli.argument('-t', '--no-temp', arg_only=True, action='store_true', help="Remove temporary files during build.") | 16 | @cli.argument('-t', '--no-temp', arg_only=True, action='store_true', help="Remove temporary files during build.") |
| 16 | @cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") | 17 | @cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.") |
| 17 | @cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") | 18 | @cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.") |
| @@ -37,7 +38,11 @@ def mass_compile(cli): | |||
| 37 | builddir = Path(QMK_FIRMWARE) / '.build' | 38 | builddir = Path(QMK_FIRMWARE) / '.build' |
| 38 | makefile = builddir / 'parallel_kb_builds.mk' | 39 | makefile = builddir / 'parallel_kb_builds.mk' |
| 39 | 40 | ||
| 40 | targets = search_keymap_targets(cli.args.keymap, cli.args.filter) | 41 | if len(cli.args.builds) > 0: |
| 42 | targets = [(e[0], e[1]) for e in [b.split(':') for b in cli.args.builds]] | ||
| 43 | else: | ||
| 44 | targets = search_keymap_targets(cli.args.keymap, cli.args.filter) | ||
| 45 | |||
| 41 | if len(targets) == 0: | 46 | if len(targets) == 0: |
| 42 | return | 47 | return |
| 43 | 48 | ||
| @@ -71,9 +76,6 @@ all: {keyboard_safe}_{keymap_name}_binary | |||
| 71 | f"""\ | 76 | f"""\ |
| 72 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.elf" 2>/dev/null || true | 77 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.elf" 2>/dev/null || true |
| 73 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.map" 2>/dev/null || true | 78 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.map" 2>/dev/null || true |
| 74 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.hex" 2>/dev/null || true | ||
| 75 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.bin" 2>/dev/null || true | ||
| 76 | @rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.uf2" 2>/dev/null || true | ||
| 77 | @rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}" || true | 79 | @rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}" || true |
| 78 | @rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}_{keymap_name}" || true | 80 | @rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}_{keymap_name}" || true |
| 79 | """# noqa | 81 | """# noqa |
