diff options
author | Keith Short <keithshort@chromium.org> | 2022-09-27 13:09:40 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-14 20:48:55 +0000 |
commit | 559dd246cfd2c20c58bbb316de27e0ec85552593 (patch) | |
tree | 7394d498c7eb4c8801930a4dbe478de452b0359f /zephyr | |
parent | 7325b164157eaf3dfd5af35bb115f229cb4a2c29 (diff) | |
download | chrome-ec-559dd246cfd2c20c58bbb316de27e0ec85552593.tar.gz |
zmake: Split out build arguments
Create a subset of arguments used for build commands. This will be used
by the compare builds option added later.
BUG=none
BRANCH=none
TEST=zmake/run_tests.sh
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I4ac520c56059fcff75831eabd4cc7e3f3fa2dcbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957414
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/zmake/README.md | 18 | ||||
-rw-r--r-- | zephyr/zmake/zmake/__main__.py | 49 |
2 files changed, 37 insertions, 30 deletions
diff --git a/zephyr/zmake/README.md b/zephyr/zmake/README.md index e424b66ca0..6efc495ec5 100644 --- a/zephyr/zmake/README.md +++ b/zephyr/zmake/README.md @@ -35,7 +35,7 @@ Chromium OS's meta-build tool for Zephyr ### zmake configure -**Usage:** `zmake configure [-h] [-t TOOLCHAIN] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--extra-cflags EXTRA_CFLAGS] [--delete-intermediates] (-a | project_name [project_name ...])` +**Usage:** `zmake configure [-h] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--delete-intermediates] [-t TOOLCHAIN] [--extra-cflags EXTRA_CFLAGS] (-a | project_name [project_name ...])` #### Positional Arguments @@ -48,7 +48,6 @@ Chromium OS's meta-build tool for Zephyr | | | |---|---| | `-h`, `--help` | show this help message and exit | -| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | | `--bringup` | Enable bringup debugging features | | `--clobber` | Delete existing build directories, even if configuration is unchanged | | `--static` | Generate static version information for reproducible builds | @@ -56,13 +55,14 @@ Chromium OS's meta-build tool for Zephyr | `--allow-warnings` | Do not treat warnings as errors | | `-B BUILD_DIR`, `--build-dir BUILD_DIR` | Root build directory, project files will be in ${build_dir}/${project_name} | | `-c`, `--coverage` | Enable CONFIG_COVERAGE Kconfig. | -| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `--delete-intermediates` | Delete intermediate files to save disk space | +| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | +| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `-a`, `--all` | Select all projects | ### zmake build -**Usage:** `zmake build [-h] [-t TOOLCHAIN] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--extra-cflags EXTRA_CFLAGS] [--delete-intermediates] (-a | project_name [project_name ...])` +**Usage:** `zmake build [-h] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--delete-intermediates] [-t TOOLCHAIN] [--extra-cflags EXTRA_CFLAGS] (-a | project_name [project_name ...])` #### Positional Arguments @@ -75,7 +75,6 @@ Chromium OS's meta-build tool for Zephyr | | | |---|---| | `-h`, `--help` | show this help message and exit | -| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | | `--bringup` | Enable bringup debugging features | | `--clobber` | Delete existing build directories, even if configuration is unchanged | | `--static` | Generate static version information for reproducible builds | @@ -83,8 +82,9 @@ Chromium OS's meta-build tool for Zephyr | `--allow-warnings` | Do not treat warnings as errors | | `-B BUILD_DIR`, `--build-dir BUILD_DIR` | Root build directory, project files will be in ${build_dir}/${project_name} | | `-c`, `--coverage` | Enable CONFIG_COVERAGE Kconfig. | -| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `--delete-intermediates` | Delete intermediate files to save disk space | +| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | +| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `-a`, `--all` | Select all projects | ### zmake list-projects @@ -106,7 +106,7 @@ Chromium OS's meta-build tool for Zephyr ### zmake test -**Usage:** `zmake test [-h] [--no-rebuild] [-t TOOLCHAIN] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--extra-cflags EXTRA_CFLAGS] [--delete-intermediates] (-a | project_name [project_name ...])` +**Usage:** `zmake test [-h] [--no-rebuild] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--delete-intermediates] [-t TOOLCHAIN] [--extra-cflags EXTRA_CFLAGS] (-a | project_name [project_name ...])` #### Positional Arguments @@ -120,7 +120,6 @@ Chromium OS's meta-build tool for Zephyr |---|---| | `-h`, `--help` | show this help message and exit | | `--no-rebuild` | Do not configure or build before running tests. | -| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | | `--bringup` | Enable bringup debugging features | | `--clobber` | Delete existing build directories, even if configuration is unchanged | | `--static` | Generate static version information for reproducible builds | @@ -128,8 +127,9 @@ Chromium OS's meta-build tool for Zephyr | `--allow-warnings` | Do not treat warnings as errors | | `-B BUILD_DIR`, `--build-dir BUILD_DIR` | Root build directory, project files will be in ${build_dir}/${project_name} | | `-c`, `--coverage` | Enable CONFIG_COVERAGE Kconfig. | -| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `--delete-intermediates` | Delete intermediate files to save disk space | +| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | +| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | | `-a`, `--all` | Select all projects | ### zmake testall diff --git a/zephyr/zmake/zmake/__main__.py b/zephyr/zmake/zmake/__main__.py index cc3b1708be..f0f2098cf5 100644 --- a/zephyr/zmake/zmake/__main__.py +++ b/zephyr/zmake/zmake/__main__.py @@ -177,12 +177,14 @@ def get_argparser(): help="Set up a build directory to be built later by the build subcommand", ) add_common_configure_args(configure) + add_common_build_args(configure) build = sub.add_parser( "build", help="Configure and build projects", ) add_common_configure_args(build) + add_common_build_args(build) list_projects = sub.add_parser( "list-projects", @@ -216,6 +218,7 @@ def get_argparser(): help="Do not configure or build before running tests.", ) add_common_configure_args(test) + add_common_build_args(test) testall = sub.add_parser( "testall", @@ -259,12 +262,35 @@ def get_argparser(): return parser, sub -def add_common_configure_args(sub_parser: argparse.ArgumentParser): - """Adds common arguments used by configure-like subcommands.""" +def add_common_build_args(sub_parser: argparse.ArgumentParser): + """Adds common arguments used by build-like subcommands""" sub_parser.add_argument( "-t", "--toolchain", help="Name of toolchain to use" ) sub_parser.add_argument( + "--extra-cflags", + help="Additional CFLAGS to use for target builds", + ) + group = sub_parser.add_mutually_exclusive_group(required=True) + group.add_argument( + "-a", + "--all", + action="store_true", + dest="all_projects", + help="Select all projects", + ) + group.add_argument( + "project_names", + nargs="*", + metavar="project_name", + help="Name(s) of the project(s) to build", + default=[], + ) + + +def add_common_configure_args(sub_parser: argparse.ArgumentParser): + """Adds common arguments used by configure-like subcommands.""" + sub_parser.add_argument( "--bringup", action="store_true", dest="bringup", @@ -309,30 +335,11 @@ def add_common_configure_args(sub_parser: argparse.ArgumentParser): help="Enable CONFIG_COVERAGE Kconfig.", ) sub_parser.add_argument( - "--extra-cflags", - help="Additional CFLAGS to use for target builds", - ) - sub_parser.add_argument( "--delete-intermediates", action="store_true", dest="delete_intermediates", help="Delete intermediate files to save disk space", ) - group = sub_parser.add_mutually_exclusive_group(required=True) - group.add_argument( - "-a", - "--all", - action="store_true", - dest="all_projects", - help="Select all projects", - ) - group.add_argument( - "project_names", - nargs="*", - metavar="project_name", - help="Name(s) of the project(s) to build", - default=[], - ) def main(argv=None): |