]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/workspace_tools/build_travis.py
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / workspace_tools / build_travis.py
1 #!/usr/bin/env python2
2
3 """
4 Travis-CI build script
5
6 mbed SDK
7 Copyright (c) 2011-2013 ARM Limited
8
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
12
13 http://www.apache.org/licenses/LICENSE-2.0
14
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 """
21
22 import os
23 import sys
24
25 ################################################################################
26 # Configure builds here
27 # "libs" can contain "dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat"
28
29 build_list = (
30 { "target": "LPC1768", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat"] },
31 { "target": "LPC2368", "toolchains": "GCC_ARM", "libs": ["fat"] },
32 { "target": "LPC11U24", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
33 { "target": "OC_MBUINO", "toolchains": "GCC_ARM", "libs": ["fat"] },
34
35 { "target": "LPC11U24_301", "toolchains": "GCC_ARM", "libs": ["fat"] },
36
37 { "target": "NUCLEO_L053R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
38 { "target": "NUCLEO_L152RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
39 { "target": "NUCLEO_F030R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
40 { "target": "NUCLEO_F070RB", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
41 { "target": "NUCLEO_F072RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
42 { "target": "NUCLEO_F091RC", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
43 { "target": "NUCLEO_F103RB", "toolchains": "GCC_ARM", "libs": ["fat"] },
44 { "target": "NUCLEO_F302R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
45 { "target": "NUCLEO_F334R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
46 { "target": "NUCLEO_F401RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
47 { "target": "NUCLEO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
48
49 { "target": "MTS_MDOT_F405RG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] },
50 { "target": "MTS_MDOT_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] },
51 { "target": "MTS_DRAGONFLY_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
52 { "target": "ARCH_MAX", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
53
54 { "target": "DISCO_F051R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
55 { "target": "DISCO_F334C8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
56 { "target": "DISCO_F401VC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
57 { "target": "DISCO_F407VG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
58 { "target": "DISCO_F429ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
59
60 { "target": "LPC1114", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
61 { "target": "LPC11U35_401", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
62 { "target": "UBLOX_C027", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
63 { "target": "LPC11U35_501", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
64 { "target": "LPC11U68", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
65 { "target": "LPC11U37H_401", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
66
67 { "target": "KL05Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
68 { "target": "KL25Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
69 { "target": "KL43Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
70 { "target": "KL46Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
71 { "target": "K20D50M", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
72 { "target": "TEENSY3_1", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
73 { "target": "K64F", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
74 { "target": "LPC4088", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
75 { "target": "ARCH_PRO", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
76 { "target": "LPC1549", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
77 { "target": "NRF51822", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
78 )
79
80 ################################################################################
81 # Configure example test building (linking against external mbed SDK libraries liek fat or rtos)
82
83 linking_list = [
84 {"target": "LPC1768",
85 "toolchains": "GCC_ARM",
86 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
87 "eth" : ["NET_1", "NET_2", "NET_3", "NET_4"],
88 "fat" : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
89 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
90 "usb" : ["USB_1", "USB_2" ,"USB_3"],
91 }
92 }
93 ]
94
95 ################################################################################
96
97 # Driver
98
99 def run_builds(dry_run):
100 for build in build_list:
101 toolchain_list = build["toolchains"]
102 if type(toolchain_list) != type([]): toolchain_list = [toolchain_list]
103 for toolchain in toolchain_list:
104 cmdline = "python workspace_tools/build.py -m %s -t %s -j 4 -c --silent "% (build["target"], toolchain)
105 libs = build.get("libs", [])
106 if libs:
107 cmdline = cmdline + " ".join(["--" + l for l in libs])
108 print "Executing: " + cmdline
109 if not dry_run:
110 if os.system(cmdline) != 0:
111 sys.exit(1)
112
113
114 def run_test_linking(dry_run):
115 """ Function run make.py commands to build and link simple mbed SDK
116 tests against few libraries to make sure there are no simple linking errors.
117 """
118 for link in linking_list:
119 toolchain_list = link["toolchains"]
120 if type(toolchain_list) != type([]):
121 toolchain_list = [toolchain_list]
122 for toolchain in toolchain_list:
123 tests = link["tests"]
124 # Call make.py for each test group for particular library
125 for test_lib in tests:
126 test_names = tests[test_lib]
127 test_lib_switch = "--" + test_lib if test_lib else ""
128 cmdline = "python workspace_tools/make.py -m %s -t %s -c --silent %s -n %s " % (link["target"], toolchain, test_lib_switch, ",".join(test_names))
129 print "Executing: " + cmdline
130 if not dry_run:
131 if os.system(cmdline) != 0:
132 sys.exit(1)
133
134
135 if __name__ == "__main__":
136 run_builds("-s" in sys.argv)
137 run_test_linking("-s" in sys.argv)
Imprint / Impressum