mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
Tools: added --build-target to configure_all.py
This commit is contained in:
parent
43275ac509
commit
87b65698ba
@ -5,7 +5,6 @@ script to run configre for all hwdef.dat, to check for syntax errors
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import fnmatch
|
||||
@ -14,9 +13,11 @@ import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description='configure all ChibiOS boards')
|
||||
parser.add_argument('--build', action='store_true', default=False, help='build as well as configure')
|
||||
parser.add_argument('--build-target', default='copter', help='build target')
|
||||
parser.add_argument('--stop', action='store_true', default=False, help='stop on build fail')
|
||||
parser.add_argument('--no-bl', action='store_true', default=False, help="don't check bootloader builds")
|
||||
parser.add_argument('--pattern', default='*')
|
||||
parser.add_argument('--python', default='python')
|
||||
args = parser.parse_args()
|
||||
|
||||
os.environ['PYTHONUNBUFFERED'] = '1'
|
||||
@ -47,22 +48,24 @@ for board in get_board_list():
|
||||
if not fnmatch.fnmatch(board, args.pattern):
|
||||
continue
|
||||
print("Configuring for %s" % board)
|
||||
run_program(["./waf", "configure", "--board", board], "configure: " + board)
|
||||
run_program([args.python, "waf", "configure", "--board", board], "configure: " + board)
|
||||
if args.build:
|
||||
if board == "iomcu":
|
||||
target = "iofirmware"
|
||||
elif board in ['CUAV_GPS', 'ZubaxGNSS'] or board.startswith('f103') or board.startswith('f303'):
|
||||
target = "AP_Periph"
|
||||
else:
|
||||
target = "copter"
|
||||
run_program(["./waf", target], "build: " + board)
|
||||
target = args.build_target
|
||||
run_program([args.python, "waf", target], "build: " + board)
|
||||
if args.no_bl:
|
||||
continue
|
||||
# check for bootloader def
|
||||
hwdef_bl = os.path.join('libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef-bl.dat' % board)
|
||||
if os.path.exists(hwdef_bl):
|
||||
print("Configuring bootloader for %s" % board)
|
||||
run_program(["./waf", "configure", "--board", board, "--bootloader"], "configure: " + board + "-bl")
|
||||
run_program([args.python, "waf", "configure", "--board", board, "--bootloader"], "configure: " + board + "-bl")
|
||||
if args.build:
|
||||
run_program(["./waf", "bootloader"], "build: " + board + "-bl")
|
||||
run_program([args.python, "waf", "bootloader"], "build: " + board + "-bl")
|
||||
|
||||
if len(failures) > 0:
|
||||
print("Failed builds:")
|
||||
|
Loading…
Reference in New Issue
Block a user