|
| 1 | +""" |
| 2 | +mbed SDK |
| 3 | +Copyright (c) 2011-2016 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 os.path import splitext, basename |
| 18 | + |
| 19 | +from tools.export.gnuarmeclipse import GNUARMEclipse |
| 20 | + |
| 21 | + |
| 22 | +class MCUXpresso(GNUARMEclipse): |
| 23 | + NAME = 'MCUXpresso' |
| 24 | + TOOLCHAIN = 'GCC_ARM' |
| 25 | + |
| 26 | + MBED_CONFIG_HEADER_SUPPORTED = True |
| 27 | + |
| 28 | + TARGETS = [ |
| 29 | + 'LPC54114', |
| 30 | + ] |
| 31 | + |
| 32 | + def generate(self): |
| 33 | + self.resources.win_to_unix() |
| 34 | + libraries = [] |
| 35 | + for lib in self.resources.libraries: |
| 36 | + l, _ = splitext(basename(lib)) |
| 37 | + libraries.append(l[3:]) |
| 38 | + |
| 39 | + self.compute_exclusions() |
| 40 | + |
| 41 | + ctx = { |
| 42 | + 'name': self.project_name, |
| 43 | + 'include_paths': self.resources.inc_dirs, |
| 44 | + 'linker_script': self.resources.linker_script, |
| 45 | + 'object_files': self.resources.objects, |
| 46 | + 'libraries': libraries, |
| 47 | + 'exclude': '|'.join(self.excluded_folders), |
| 48 | + 'symbols': self.toolchain.get_symbols() |
| 49 | + } |
| 50 | + ctx.update(self.flags) |
| 51 | + self.gen_file('mcuxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project') |
| 52 | + self.gen_file('mcuxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |
0 commit comments