mirror of https://github.com/ARMmbed/mbed-os.git
Make mcu and tool arguments many and update all consumers of them
parent
d757f35d15
commit
7b3ef2179f
|
@ -159,18 +159,10 @@ if __name__ == '__main__':
|
|||
exit(0)
|
||||
|
||||
# Get target list
|
||||
if options.mcu:
|
||||
mcu_list = (options.mcu).split(",")
|
||||
targets = mcu_list
|
||||
else:
|
||||
targets = TARGET_NAMES
|
||||
targets = options.mcu if options.mcu else TARGET_NAMES
|
||||
|
||||
# Get toolchains list
|
||||
if options.tool:
|
||||
toolchain_list = (options.tool).split(",")
|
||||
toolchains = toolchain_list
|
||||
else:
|
||||
toolchains = TOOLCHAINS
|
||||
toolchains = options.tool if options.tool else TOOLCHAINS
|
||||
|
||||
# Get libraries list
|
||||
libraries = []
|
||||
|
|
|
@ -204,12 +204,12 @@ if __name__ == '__main__':
|
|||
# Target
|
||||
if options.mcu is None :
|
||||
args_error(parser, "[ERROR] You should specify an MCU")
|
||||
mcu = options.mcu
|
||||
mcu = options.mcu[0]
|
||||
|
||||
# Toolchain
|
||||
if options.tool is None:
|
||||
args_error(parser, "[ERROR] You should specify a TOOLCHAIN")
|
||||
toolchain = options.tool
|
||||
toolchain = options.tool[0]
|
||||
|
||||
# Test
|
||||
for test_no in p:
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
from argparse import ArgumentParser
|
||||
from tools.toolchains import TOOLCHAINS
|
||||
from tools.targets import TARGET_NAMES
|
||||
from utils import argparse_uppercase_type, argparse_lowercase_hyphen_type
|
||||
from utils import argparse_uppercase_type, argparse_lowercase_hyphen_type, argparse_many
|
||||
|
||||
|
||||
def get_default_options_parser(add_clean=True, add_options=True):
|
||||
|
@ -31,12 +31,12 @@ def get_default_options_parser(add_clean=True, add_options=True):
|
|||
parser.add_argument("-m", "--mcu",
|
||||
help="build for the given MCU (%s)" % ', '.join(targetnames),
|
||||
metavar="MCU",
|
||||
type=argparse_uppercase_type(targetnames, "MCU"))
|
||||
type=argparse_many(argparse_uppercase_type(targetnames, "MCU")))
|
||||
|
||||
parser.add_argument("-t", "--tool",
|
||||
help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
|
||||
metavar="TOOLCHAIN",
|
||||
type=argparse_uppercase_type(toolchainlist, "toolchain"))
|
||||
type=argparse_many(argparse_uppercase_type(toolchainlist, "toolchain")))
|
||||
|
||||
if add_clean:
|
||||
parser.add_argument("-c", "--clean", action="store_true", default=False,
|
||||
|
|
|
@ -137,7 +137,7 @@ if __name__ == '__main__':
|
|||
base_source_paths = ['.']
|
||||
|
||||
|
||||
target = TARGET_MAP[options.mcu]
|
||||
target = TARGET_MAP[options.mcu[0]]
|
||||
|
||||
build_report = {}
|
||||
build_properties = {}
|
||||
|
@ -145,7 +145,7 @@ if __name__ == '__main__':
|
|||
library_build_success = False
|
||||
try:
|
||||
# Build sources
|
||||
build_library(base_source_paths, options.build_dir, target, options.tool,
|
||||
build_library(base_source_paths, options.build_dir, target, options.tool[0],
|
||||
options=options.options,
|
||||
jobs=options.jobs,
|
||||
clean=options.clean,
|
||||
|
@ -171,7 +171,7 @@ if __name__ == '__main__':
|
|||
print "Failed to build library"
|
||||
else:
|
||||
# Build all the tests
|
||||
test_build_success, test_build = build_tests(tests, [options.build_dir], options.build_dir, target, options.tool,
|
||||
test_build_success, test_build = build_tests(tests, [options.build_dir], options.build_dir, target, options.tool[0],
|
||||
options=options.options,
|
||||
clean=options.clean,
|
||||
report=build_report,
|
||||
|
|
Loading…
Reference in New Issue