Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/Intel: Add build_bios.py option to skip rebuilding BaseTools #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions Platform/Intel/build_bios.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import configparser


def pre_build(build_config, build_type="DEBUG", silent=False, toolchain=None):
def pre_build(build_config, build_type="DEBUG", silent=False, toolchain=None, skip_tools=False):
"""Sets the environment variables that shall be used for the build

:param build_config: The build configuration as defined in the JSON
Expand Down Expand Up @@ -229,24 +229,25 @@ def pre_build(build_config, build_type="DEBUG", silent=False, toolchain=None):
shell = False
command = ["make", "-C", os.path.join(config["BASE_TOOLS_PATH"])]

_, _, result, return_code = execute_script(command, config, shell=shell)
if return_code != 0:
#
# If the BaseTools build fails, then run a clean build and retry
#
clean_command = ["nmake", "-f",
os.path.join(config["BASE_TOOLS_PATH"], "Makefile"),
"clean"]
if os.name == "posix":
clean_command = ["make", "-C",
os.path.join(config["BASE_TOOLS_PATH"]), "clean"]
_, _, result, return_code = execute_script(clean_command, config,
shell=shell)
if return_code != 0:
build_failed(config)
if not skip_tools:
_, _, result, return_code = execute_script(command, config, shell=shell)
if return_code != 0:
build_failed(config)
#
# If the BaseTools build fails, then run a clean build and retry
#
clean_command = ["nmake", "-f",
os.path.join(config["BASE_TOOLS_PATH"], "Makefile"),
"clean"]
if os.name == "posix":
clean_command = ["make", "-C",
os.path.join(config["BASE_TOOLS_PATH"]), "clean"]
_, _, result, return_code = execute_script(clean_command, config,
shell=shell)
if return_code != 0:
build_failed(config)
_, _, result, return_code = execute_script(command, config, shell=shell)
if return_code != 0:
build_failed(config)

#
# build platform silicon tools
Expand Down Expand Up @@ -1056,6 +1057,9 @@ def __call__(self, parser, namespace, values, option_string=None):
parser.add_argument('--list', '-l', action=PrintPlatforms,
help='lists available platforms', nargs=0)

parser.add_argument('--skiptools', '-s', dest='skip_tools',
help='skips rebuilding base tools', action='store_true')

parser.add_argument('--cleanall', dest='clean_all',
help='cleans all', action='store_true')

Expand Down Expand Up @@ -1140,7 +1144,8 @@ def main():
config = pre_build(config,
build_type=arguments.target,
toolchain=arguments.toolchain,
silent=arguments.silent)
silent=arguments.silent,
skip_tools=arguments.skip_tools)

# build selected platform
config = build(config)
Expand Down
Loading