Clone of official tools
export/kds/__init__.py@47:21ae3e5a7128, 2021-02-04 (annotated)
- Committer:
- Anders Blomdell
- Date:
- Thu Feb 04 17:17:13 2021 +0100
- Revision:
- 47:21ae3e5a7128
- Parent:
- 43:2a7da56ebd24
Add a few normpath calls
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
The Other Jimmy |
35:da9c89f8be7d | 1 | """ |
The Other Jimmy |
35:da9c89f8be7d | 2 | mbed SDK |
The Other Jimmy |
35:da9c89f8be7d | 3 | Copyright (c) 2011-2016 ARM Limited |
The Other Jimmy |
35:da9c89f8be7d | 4 | |
The Other Jimmy |
35:da9c89f8be7d | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
The Other Jimmy |
35:da9c89f8be7d | 6 | you may not use this file except in compliance with the License. |
The Other Jimmy |
35:da9c89f8be7d | 7 | You may obtain a copy of the License at |
The Other Jimmy |
35:da9c89f8be7d | 8 | |
The Other Jimmy |
35:da9c89f8be7d | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
The Other Jimmy |
35:da9c89f8be7d | 10 | |
The Other Jimmy |
35:da9c89f8be7d | 11 | Unless required by applicable law or agreed to in writing, software |
The Other Jimmy |
35:da9c89f8be7d | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
The Other Jimmy |
35:da9c89f8be7d | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
The Other Jimmy |
35:da9c89f8be7d | 14 | See the License for the specific language governing permissions and |
The Other Jimmy |
35:da9c89f8be7d | 15 | limitations under the License. |
The Other Jimmy |
35:da9c89f8be7d | 16 | """ |
The Other Jimmy |
35:da9c89f8be7d | 17 | from os.path import splitext, basename |
theotherjimmy |
43:2a7da56ebd24 | 18 | from os import remove |
The Other Jimmy |
35:da9c89f8be7d | 19 | |
theotherjimmy |
40:7d3fa6b99b2b | 20 | from tools.export.exporters import Exporter, deprecated_exporter |
The Other Jimmy |
35:da9c89f8be7d | 21 | |
The Other Jimmy |
35:da9c89f8be7d | 22 | |
theotherjimmy |
40:7d3fa6b99b2b | 23 | @deprecated_exporter |
The Other Jimmy |
35:da9c89f8be7d | 24 | class KDS(Exporter): |
The Other Jimmy |
35:da9c89f8be7d | 25 | NAME = 'Kinetis Design Studio' |
The Other Jimmy |
35:da9c89f8be7d | 26 | TOOLCHAIN = 'GCC_ARM' |
The Other Jimmy |
35:da9c89f8be7d | 27 | |
The Other Jimmy |
35:da9c89f8be7d | 28 | TARGETS = [ |
The Other Jimmy |
35:da9c89f8be7d | 29 | 'K64F', |
The Other Jimmy |
35:da9c89f8be7d | 30 | 'HEXIWEAR', |
The Other Jimmy |
35:da9c89f8be7d | 31 | 'K22F', |
The Other Jimmy |
35:da9c89f8be7d | 32 | ] |
The Other Jimmy |
35:da9c89f8be7d | 33 | |
The Other Jimmy |
35:da9c89f8be7d | 34 | def generate(self): |
The Other Jimmy |
35:da9c89f8be7d | 35 | libraries = [] |
theotherjimmy |
43:2a7da56ebd24 | 36 | for lib in self.libraries: |
The Other Jimmy |
35:da9c89f8be7d | 37 | l, _ = splitext(basename(lib)) |
The Other Jimmy |
35:da9c89f8be7d | 38 | libraries.append(l[3:]) |
The Other Jimmy |
35:da9c89f8be7d | 39 | |
The Other Jimmy |
35:da9c89f8be7d | 40 | ctx = { |
The Other Jimmy |
35:da9c89f8be7d | 41 | 'name': self.project_name, |
The Other Jimmy |
35:da9c89f8be7d | 42 | 'include_paths': self.resources.inc_dirs, |
The Other Jimmy |
35:da9c89f8be7d | 43 | 'linker_script': self.resources.linker_script, |
The Other Jimmy |
35:da9c89f8be7d | 44 | 'object_files': self.resources.objects, |
The Other Jimmy |
35:da9c89f8be7d | 45 | 'libraries': libraries, |
The Other Jimmy |
35:da9c89f8be7d | 46 | 'symbols': self.toolchain.get_symbols() |
The Other Jimmy |
35:da9c89f8be7d | 47 | } |
The Other Jimmy |
35:da9c89f8be7d | 48 | self.gen_file('kds/%s_project.tmpl' % self.target.lower(), ctx, '.project') |
The Other Jimmy |
35:da9c89f8be7d | 49 | self.gen_file('kds/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |
The Other Jimmy |
35:da9c89f8be7d | 50 | self.gen_file('kds/launch.tmpl', ctx, '%s.launch' % self.project_name) |
theotherjimmy |
43:2a7da56ebd24 | 51 | |
theotherjimmy |
43:2a7da56ebd24 | 52 | @staticmethod |
theotherjimmy |
43:2a7da56ebd24 | 53 | def clean(project_name): |
theotherjimmy |
43:2a7da56ebd24 | 54 | remove('%s.launch' % project_name) |