Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/scripts/build_peripherals.py
Views: 1798
#!/usr/bin/env python12"""3script to test build all of our peripheral firmwares4"""56import os7import shutil8import subprocess9import sys10import fnmatch11import board_list1213# get command line arguments14from argparse import ArgumentParser15parser = ArgumentParser(description='build_peripherals')16parser.add_argument("pattern", type=str, default='*', help="board wildcard pattern")17parser.add_argument("--debug", action='store_true', default=False, help="build with debug symbols")18parser.add_argument("--stop", action='store_true', default=False, help="stop on a failed build")19parser.add_argument("--configure-only", action='store_true', default=False, help="only run configure")20parser.add_argument("--noclean", action='store_true', default=False, help="don't run waf clean")21args = parser.parse_args()2223os.environ['PYTHONUNBUFFERED'] = '1'2425failed_boards = set()2627def run_program(cmd_list):28print("Running (%s)" % " ".join(cmd_list))29retcode = subprocess.call(cmd_list)30if retcode != 0:31print("Build failed: %s" % ' '.join(cmd_list))32return False33return True3435def build_board(board):36configure_args = "--board %s --no-submodule-update --Werror" % board37configure_args = configure_args.split()38if args.debug:39print("Building with debug symbols")40configure_args.append("--debug")41if not run_program(["./waf", "configure"] + configure_args):42return False43if args.configure_only:44return True45if not args.noclean and not run_program(["./waf", "clean"]):46return False47if not run_program(["./waf", "AP_Periph"]):48return False49return True5051boards = board_list.BoardList().find_ap_periph_boards()5253for board in boards:54if not fnmatch.fnmatch(board, args.pattern):55continue56print("Building for %s" % board)57if not build_board(board):58failed_boards.add(board)59if args.stop:60break61continue6263if len(failed_boards):64print("Failed boards: %s" % list(failed_boards))65else:66print("No failed builds")67686970