Clone of official tools
export/lpcxpresso/__init__.py@43:2a7da56ebd24, 2018-09-25 (annotated)
- Committer:
- theotherjimmy
- Date:
- Tue Sep 25 13:43:09 2018 -0500
- Revision:
- 43:2a7da56ebd24
- Parent:
- 40:7d3fa6b99b2b
Release 5.10.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
The Other Jimmy |
36:96847d42f010 | 1 | """ |
The Other Jimmy |
36:96847d42f010 | 2 | mbed SDK |
The Other Jimmy |
36:96847d42f010 | 3 | Copyright (c) 2011-2016 ARM Limited |
The Other Jimmy |
36:96847d42f010 | 4 | |
The Other Jimmy |
36:96847d42f010 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
The Other Jimmy |
36:96847d42f010 | 6 | you may not use this file except in compliance with the License. |
The Other Jimmy |
36:96847d42f010 | 7 | You may obtain a copy of the License at |
The Other Jimmy |
36:96847d42f010 | 8 | |
The Other Jimmy |
36:96847d42f010 | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
The Other Jimmy |
36:96847d42f010 | 10 | |
The Other Jimmy |
36:96847d42f010 | 11 | Unless required by applicable law or agreed to in writing, software |
The Other Jimmy |
36:96847d42f010 | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
The Other Jimmy |
36:96847d42f010 | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
The Other Jimmy |
36:96847d42f010 | 14 | See the License for the specific language governing permissions and |
The Other Jimmy |
36:96847d42f010 | 15 | limitations under the License. |
The Other Jimmy |
36:96847d42f010 | 16 | """ |
The Other Jimmy |
36:96847d42f010 | 17 | from os.path import splitext, basename |
The Other Jimmy |
36:96847d42f010 | 18 | |
theotherjimmy |
40:7d3fa6b99b2b | 19 | from tools.export.exporters import Exporter, deprecated_exporter |
The Other Jimmy |
36:96847d42f010 | 20 | |
theotherjimmy |
40:7d3fa6b99b2b | 21 | @deprecated_exporter |
The Other Jimmy |
36:96847d42f010 | 22 | class LPCXpresso(Exporter): |
The Other Jimmy |
36:96847d42f010 | 23 | NAME = 'LPCXpresso' |
The Other Jimmy |
36:96847d42f010 | 24 | TOOLCHAIN = 'GCC_ARM' |
The Other Jimmy |
36:96847d42f010 | 25 | |
The Other Jimmy |
36:96847d42f010 | 26 | MBED_CONFIG_HEADER_SUPPORTED = True |
The Other Jimmy |
36:96847d42f010 | 27 | |
The Other Jimmy |
36:96847d42f010 | 28 | TARGETS = [ |
The Other Jimmy |
36:96847d42f010 | 29 | 'LPC1768', |
The Other Jimmy |
36:96847d42f010 | 30 | 'LPC4088', |
The Other Jimmy |
36:96847d42f010 | 31 | 'LPC4088_DM', |
The Other Jimmy |
36:96847d42f010 | 32 | 'LPC4330_M4', |
The Other Jimmy |
36:96847d42f010 | 33 | 'LPC1114', |
The Other Jimmy |
36:96847d42f010 | 34 | 'LPC11U35_401', |
The Other Jimmy |
36:96847d42f010 | 35 | 'LPC11U35_501', |
The Other Jimmy |
36:96847d42f010 | 36 | 'UBLOX_C027', |
The Other Jimmy |
36:96847d42f010 | 37 | 'ARCH_PRO', |
The Other Jimmy |
36:96847d42f010 | 38 | 'LPC1549', |
The Other Jimmy |
36:96847d42f010 | 39 | 'LPC11U68', |
The Other Jimmy |
36:96847d42f010 | 40 | 'LPCCAPPUCCINO', |
The Other Jimmy |
36:96847d42f010 | 41 | 'LPC824', |
The Other Jimmy |
36:96847d42f010 | 42 | 'LPC11U37H_401', |
The Other Jimmy |
36:96847d42f010 | 43 | ] |
The Other Jimmy |
36:96847d42f010 | 44 | |
The Other Jimmy |
36:96847d42f010 | 45 | def generate(self): |
The Other Jimmy |
36:96847d42f010 | 46 | libraries = [] |
theotherjimmy |
43:2a7da56ebd24 | 47 | for lib in self.libraries: |
The Other Jimmy |
36:96847d42f010 | 48 | l, _ = splitext(basename(lib)) |
The Other Jimmy |
36:96847d42f010 | 49 | libraries.append(l[3:]) |
The Other Jimmy |
36:96847d42f010 | 50 | |
The Other Jimmy |
36:96847d42f010 | 51 | ctx = { |
The Other Jimmy |
36:96847d42f010 | 52 | 'name': self.project_name, |
The Other Jimmy |
36:96847d42f010 | 53 | 'include_paths': self.resources.inc_dirs, |
The Other Jimmy |
36:96847d42f010 | 54 | 'linker_script': self.resources.linker_script, |
The Other Jimmy |
36:96847d42f010 | 55 | 'object_files': self.resources.objects, |
The Other Jimmy |
36:96847d42f010 | 56 | 'libraries': libraries, |
The Other Jimmy |
36:96847d42f010 | 57 | 'symbols': self.toolchain.get_symbols() |
The Other Jimmy |
36:96847d42f010 | 58 | } |
The Other Jimmy |
36:96847d42f010 | 59 | ctx.update(self.flags) |
The Other Jimmy |
36:96847d42f010 | 60 | self.gen_file('lpcxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project') |
The Other Jimmy |
36:96847d42f010 | 61 | self.gen_file('lpcxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |