Clone of official tools
export/e2studio.py@13:ab47a20b66f0, 2016-07-14 (annotated)
- Committer:
- screamer
- Date:
- Thu Jul 14 20:21:19 2016 +0100
- Revision:
- 13:ab47a20b66f0
- Child:
- 31:8ea194f6145b
Apply latest tools
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 13:ab47a20b66f0 | 1 | """ |
screamer | 13:ab47a20b66f0 | 2 | mbed SDK |
screamer | 13:ab47a20b66f0 | 3 | Copyright (c) 2011-2013 ARM Limited |
screamer | 13:ab47a20b66f0 | 4 | |
screamer | 13:ab47a20b66f0 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
screamer | 13:ab47a20b66f0 | 6 | you may not use this file except in compliance with the License. |
screamer | 13:ab47a20b66f0 | 7 | You may obtain a copy of the License at |
screamer | 13:ab47a20b66f0 | 8 | |
screamer | 13:ab47a20b66f0 | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
screamer | 13:ab47a20b66f0 | 10 | |
screamer | 13:ab47a20b66f0 | 11 | Unless required by applicable law or agreed to in writing, software |
screamer | 13:ab47a20b66f0 | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
screamer | 13:ab47a20b66f0 | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
screamer | 13:ab47a20b66f0 | 14 | See the License for the specific language governing permissions and |
screamer | 13:ab47a20b66f0 | 15 | limitations under the License. |
screamer | 13:ab47a20b66f0 | 16 | """ |
screamer | 13:ab47a20b66f0 | 17 | from exporters import Exporter |
screamer | 13:ab47a20b66f0 | 18 | from os.path import splitext, basename |
screamer | 13:ab47a20b66f0 | 19 | |
screamer | 13:ab47a20b66f0 | 20 | |
screamer | 13:ab47a20b66f0 | 21 | class E2Studio(Exporter): |
screamer | 13:ab47a20b66f0 | 22 | NAME = 'e2 studio' |
screamer | 13:ab47a20b66f0 | 23 | TOOLCHAIN = 'GCC_ARM' |
screamer | 13:ab47a20b66f0 | 24 | |
screamer | 13:ab47a20b66f0 | 25 | TARGETS = [ |
screamer | 13:ab47a20b66f0 | 26 | 'RZ_A1H', |
screamer | 13:ab47a20b66f0 | 27 | ] |
screamer | 13:ab47a20b66f0 | 28 | |
screamer | 13:ab47a20b66f0 | 29 | def generate(self): |
screamer | 13:ab47a20b66f0 | 30 | libraries = [] |
screamer | 13:ab47a20b66f0 | 31 | for lib in self.resources.libraries: |
screamer | 13:ab47a20b66f0 | 32 | l, _ = splitext(basename(lib)) |
screamer | 13:ab47a20b66f0 | 33 | libraries.append(l[3:]) |
screamer | 13:ab47a20b66f0 | 34 | |
screamer | 13:ab47a20b66f0 | 35 | ctx = { |
screamer | 13:ab47a20b66f0 | 36 | 'name': self.program_name, |
screamer | 13:ab47a20b66f0 | 37 | 'include_paths': self.resources.inc_dirs, |
screamer | 13:ab47a20b66f0 | 38 | 'linker_script': self.resources.linker_script, |
screamer | 13:ab47a20b66f0 | 39 | |
screamer | 13:ab47a20b66f0 | 40 | 'object_files': self.resources.objects, |
screamer | 13:ab47a20b66f0 | 41 | 'libraries': libraries, |
screamer | 13:ab47a20b66f0 | 42 | 'symbols': self.get_symbols() |
screamer | 13:ab47a20b66f0 | 43 | } |
screamer | 13:ab47a20b66f0 | 44 | self.gen_file('e2studio_%s_project.tmpl' % self.target.lower(), ctx, '.project') |
screamer | 13:ab47a20b66f0 | 45 | self.gen_file('e2studio_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |
screamer | 13:ab47a20b66f0 | 46 | self.gen_file('e2studio_%s_gdbinit.tmpl' % self.target.lower(), ctx, '.gdbinit') |
screamer | 13:ab47a20b66f0 | 47 | self.gen_file('e2studio_launch.tmpl', ctx, '%s OpenOCD.launch' % self.program_name) |