]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/workspace_tools/export/codered.py
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / workspace_tools / export / codered.py
1 """
2 mbed SDK
3 Copyright (c) 2011-2013 ARM Limited
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 """
17 from exporters import Exporter
18 from os.path import splitext, basename
19
20
21 class CodeRed(Exporter):
22 NAME = 'CodeRed'
23 TOOLCHAIN = 'GCC_CR'
24
25 TARGETS = [
26 'LPC1768',
27 'LPC4088',
28 'LPC4088_DM',
29 'LPC4330_M4',
30 'LPC1114',
31 'LPC11U35_401',
32 'LPC11U35_501',
33 'UBLOX_C027',
34 'ARCH_PRO',
35 'LPC1549',
36 'LPC11U68',
37 'LPCCAPPUCCINO',
38 'LPC824',
39 'LPC11U37H_401',
40 ]
41
42 def generate(self):
43 libraries = []
44 for lib in self.resources.libraries:
45 l, _ = splitext(basename(lib))
46 libraries.append(l[3:])
47
48 ctx = {
49 'name': self.program_name,
50 'include_paths': self.resources.inc_dirs,
51 'linker_script': self.resources.linker_script,
52 'object_files': self.resources.objects,
53 'libraries': libraries,
54 'symbols': self.get_symbols()
55 }
56 self.gen_file('codered_%s_project.tmpl' % self.target.lower(), ctx, '.project')
57 self.gen_file('codered_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')
Imprint / Impressum