2013-08-12 10:45:35 +00:00
|
|
|
"""
|
|
|
|
mbed SDK
|
|
|
|
Copyright (c) 2011-2013 ARM Limited
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
from time import time
|
|
|
|
from os.path import join, abspath, dirname
|
2014-05-07 13:41:12 +00:00
|
|
|
from optparse import OptionParser
|
2013-08-12 10:45:35 +00:00
|
|
|
|
|
|
|
# Be sure that the tools directory is in the search path
|
|
|
|
ROOT = abspath(join(dirname(__file__), ".."))
|
2013-12-19 13:02:57 +00:00
|
|
|
sys.path.insert(0, ROOT)
|
2013-08-12 10:45:35 +00:00
|
|
|
|
|
|
|
from workspace_tools.build_api import build_mbed_libs
|
|
|
|
from workspace_tools.targets import TARGET_MAP
|
|
|
|
|
|
|
|
OFFICIAL_MBED_LIBRARY_BUILD = (
|
2014-02-27 13:31:55 +00:00
|
|
|
('LPC11U24', ('ARM', 'uARM', 'GCC_ARM')),
|
2014-02-12 10:31:25 +00:00
|
|
|
('LPC1768', ('ARM', 'GCC_ARM', 'GCC_CR', 'GCC_CS', 'IAR')),
|
2014-02-12 11:34:06 +00:00
|
|
|
('UBLOX_C027', ('ARM', 'GCC_ARM', 'GCC_CR', 'GCC_CS', 'IAR')),
|
2014-02-12 10:31:25 +00:00
|
|
|
('LPC2368', ('ARM',)),
|
|
|
|
('LPC812', ('uARM',)),
|
|
|
|
('LPC1347', ('ARM',)),
|
|
|
|
('LPC4088', ('ARM', 'GCC_ARM', 'GCC_CR')),
|
2014-03-08 08:15:42 +00:00
|
|
|
('LPC1114', ('uARM','GCC_ARM')),
|
2014-03-17 14:45:39 +00:00
|
|
|
('LPC11U35_401', ('ARM', 'uARM','GCC_ARM','GCC_CR')),
|
|
|
|
('LPC11U35_501', ('ARM', 'uARM','GCC_ARM','GCC_CR')),
|
2014-02-20 22:47:55 +00:00
|
|
|
('LPC1549', ('uARM',)),
|
2014-02-12 10:31:25 +00:00
|
|
|
|
2014-02-18 04:12:16 +00:00
|
|
|
('KL05Z', ('ARM', 'uARM', 'GCC_ARM')),
|
|
|
|
('KL25Z', ('ARM', 'GCC_ARM')),
|
|
|
|
('KL46Z', ('ARM', 'GCC_ARM')),
|
2014-04-07 16:32:47 +00:00
|
|
|
('K64F', ('ARM',)),
|
2014-05-05 09:22:02 +00:00
|
|
|
|
2014-05-21 13:00:59 +00:00
|
|
|
('NUCLEO_F030R8', ('ARM', 'uARM')),
|
|
|
|
('NUCLEO_F072RB', ('ARM', 'uARM')),
|
2014-02-12 10:31:25 +00:00
|
|
|
('NUCLEO_F103RB', ('ARM', 'uARM')),
|
2014-03-19 14:55:30 +00:00
|
|
|
('NUCLEO_F302R8', ('ARM', 'uARM')),
|
2014-05-05 09:22:02 +00:00
|
|
|
('NUCLEO_F401RE', ('ARM', 'uARM')),
|
|
|
|
('NUCLEO_L053R8', ('ARM', 'uARM')),
|
|
|
|
('NUCLEO_L152RE', ('ARM', 'uARM')),
|
2014-05-21 13:00:59 +00:00
|
|
|
|
2014-03-11 12:09:25 +00:00
|
|
|
('NRF51822', ('ARM', )),
|
2014-05-19 12:47:09 +00:00
|
|
|
|
|
|
|
('LPC11U68', ('uARM',)),
|
2013-08-12 10:45:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2014-05-07 13:41:12 +00:00
|
|
|
parser = OptionParser()
|
|
|
|
parser.add_option('-o', '--official', dest="official_only", default=False, action="store_true",
|
|
|
|
help="Build using only the official toolchain for each target")
|
2014-05-07 21:12:23 +00:00
|
|
|
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
|
|
|
|
default=False, help="Verbose diagnostic output")
|
2014-05-07 13:41:12 +00:00
|
|
|
options, args = parser.parse_args()
|
2013-08-12 10:45:35 +00:00
|
|
|
start = time()
|
|
|
|
failures = []
|
|
|
|
successes = []
|
2014-05-07 13:41:12 +00:00
|
|
|
for target_name, toolchain_list in OFFICIAL_MBED_LIBRARY_BUILD:
|
|
|
|
if options.official_only:
|
|
|
|
toolchains = (getattr(TARGET_MAP[target_name], 'ONLINE_TOOLCHAIN', 'ARM'),)
|
|
|
|
else:
|
|
|
|
toolchains = toolchain_list
|
2013-08-12 10:45:35 +00:00
|
|
|
for toolchain in toolchains:
|
|
|
|
id = "%s::%s" % (target_name, toolchain)
|
|
|
|
try:
|
2014-05-07 21:12:23 +00:00
|
|
|
build_mbed_libs(TARGET_MAP[target_name], toolchain, verbose=options.verbose)
|
2013-08-12 10:45:35 +00:00
|
|
|
successes.append(id)
|
|
|
|
except Exception, e:
|
|
|
|
failures.append(id)
|
|
|
|
print e
|
|
|
|
|
|
|
|
# Write summary of the builds
|
|
|
|
print "\n\nCompleted in: (%.2f)s" % (time() - start)
|
|
|
|
|
|
|
|
if successes:
|
|
|
|
print "\n\nBuild successes:"
|
|
|
|
print "\n".join([" * %s" % s for s in successes])
|
|
|
|
|
|
|
|
if failures:
|
|
|
|
print "\n\nBuild failures:"
|
|
|
|
print "\n".join([" * %s" % f for f in failures])
|