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)
|
exit(0)
|
||||||
|
|
||||||
# Get target list
|
# Get target list
|
||||||
if options.mcu:
|
targets = options.mcu if options.mcu else TARGET_NAMES
|
||||||
mcu_list = (options.mcu).split(",")
|
|
||||||
targets = mcu_list
|
|
||||||
else:
|
|
||||||
targets = TARGET_NAMES
|
|
||||||
|
|
||||||
# Get toolchains list
|
# Get toolchains list
|
||||||
if options.tool:
|
toolchains = options.tool if options.tool else TOOLCHAINS
|
||||||
toolchain_list = (options.tool).split(",")
|
|
||||||
toolchains = toolchain_list
|
|
||||||
else:
|
|
||||||
toolchains = TOOLCHAINS
|
|
||||||
|
|
||||||
# Get libraries list
|
# Get libraries list
|
||||||
libraries = []
|
libraries = []
|
||||||
|
|
|
@ -204,12 +204,12 @@ if __name__ == '__main__':
|
||||||
# Target
|
# Target
|
||||||
if options.mcu is None :
|
if options.mcu is None :
|
||||||
args_error(parser, "[ERROR] You should specify an MCU")
|
args_error(parser, "[ERROR] You should specify an MCU")
|
||||||
mcu = options.mcu
|
mcu = options.mcu[0]
|
||||||
|
|
||||||
# Toolchain
|
# Toolchain
|
||||||
if options.tool is None:
|
if options.tool is None:
|
||||||
args_error(parser, "[ERROR] You should specify a TOOLCHAIN")
|
args_error(parser, "[ERROR] You should specify a TOOLCHAIN")
|
||||||
toolchain = options.tool
|
toolchain = options.tool[0]
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
for test_no in p:
|
for test_no in p:
|
||||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from tools.toolchains import TOOLCHAINS
|
from tools.toolchains import TOOLCHAINS
|
||||||
from tools.targets import TARGET_NAMES
|
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):
|
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",
|
parser.add_argument("-m", "--mcu",
|
||||||
help="build for the given MCU (%s)" % ', '.join(targetnames),
|
help="build for the given MCU (%s)" % ', '.join(targetnames),
|
||||||
metavar="MCU",
|
metavar="MCU",
|
||||||
type=argparse_uppercase_type(targetnames, "MCU"))
|
type=argparse_many(argparse_uppercase_type(targetnames, "MCU")))
|
||||||
|
|
||||||
parser.add_argument("-t", "--tool",
|
parser.add_argument("-t", "--tool",
|
||||||
help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
|
help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
|
||||||
metavar="TOOLCHAIN",
|
metavar="TOOLCHAIN",
|
||||||
type=argparse_uppercase_type(toolchainlist, "toolchain"))
|
type=argparse_many(argparse_uppercase_type(toolchainlist, "toolchain")))
|
||||||
|
|
||||||
if add_clean:
|
if add_clean:
|
||||||
parser.add_argument("-c", "--clean", action="store_true", default=False,
|
parser.add_argument("-c", "--clean", action="store_true", default=False,
|
||||||
|
|
|
@ -137,7 +137,7 @@ if __name__ == '__main__':
|
||||||
base_source_paths = ['.']
|
base_source_paths = ['.']
|
||||||
|
|
||||||
|
|
||||||
target = TARGET_MAP[options.mcu]
|
target = TARGET_MAP[options.mcu[0]]
|
||||||
|
|
||||||
build_report = {}
|
build_report = {}
|
||||||
build_properties = {}
|
build_properties = {}
|
||||||
|
@ -145,7 +145,7 @@ if __name__ == '__main__':
|
||||||
library_build_success = False
|
library_build_success = False
|
||||||
try:
|
try:
|
||||||
# Build sources
|
# 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,
|
options=options.options,
|
||||||
jobs=options.jobs,
|
jobs=options.jobs,
|
||||||
clean=options.clean,
|
clean=options.clean,
|
||||||
|
@ -171,7 +171,7 @@ if __name__ == '__main__':
|
||||||
print "Failed to build library"
|
print "Failed to build library"
|
||||||
else:
|
else:
|
||||||
# Build all the tests
|
# 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,
|
options=options.options,
|
||||||
clean=options.clean,
|
clean=options.clean,
|
||||||
report=build_report,
|
report=build_report,
|
||||||
|
|
Loading…
Reference in New Issue