Clone of official tools

Committer:
The Other Jimmy
Date:
Wed Feb 15 13:53:18 2017 -0600
Revision:
35:da9c89f8be7d
Update tools to mbed-os 5.3.5

Who changed what in which revision?

UserRevisionLine numberNew 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
The Other Jimmy 35:da9c89f8be7d 18
The Other Jimmy 35:da9c89f8be7d 19 from tools.export.exporters import Exporter
The Other Jimmy 35:da9c89f8be7d 20
The Other Jimmy 35:da9c89f8be7d 21 class CodeRed(Exporter):
The Other Jimmy 35:da9c89f8be7d 22 NAME = 'CodeRed'
The Other Jimmy 35:da9c89f8be7d 23 TOOLCHAIN = 'GCC_CR'
The Other Jimmy 35:da9c89f8be7d 24
The Other Jimmy 35:da9c89f8be7d 25 MBED_CONFIG_HEADER_SUPPORTED = True
The Other Jimmy 35:da9c89f8be7d 26
The Other Jimmy 35:da9c89f8be7d 27 TARGETS = [
The Other Jimmy 35:da9c89f8be7d 28 'LPC1768',
The Other Jimmy 35:da9c89f8be7d 29 'LPC4088',
The Other Jimmy 35:da9c89f8be7d 30 'LPC4088_DM',
The Other Jimmy 35:da9c89f8be7d 31 'LPC4330_M4',
The Other Jimmy 35:da9c89f8be7d 32 'LPC1114',
The Other Jimmy 35:da9c89f8be7d 33 'LPC11U35_401',
The Other Jimmy 35:da9c89f8be7d 34 'LPC11U35_501',
The Other Jimmy 35:da9c89f8be7d 35 'UBLOX_C027',
The Other Jimmy 35:da9c89f8be7d 36 'ARCH_PRO',
The Other Jimmy 35:da9c89f8be7d 37 'LPC1549',
The Other Jimmy 35:da9c89f8be7d 38 'LPC11U68',
The Other Jimmy 35:da9c89f8be7d 39 'LPCCAPPUCCINO',
The Other Jimmy 35:da9c89f8be7d 40 'LPC824',
The Other Jimmy 35:da9c89f8be7d 41 'LPC11U37H_401',
The Other Jimmy 35:da9c89f8be7d 42 ]
The Other Jimmy 35:da9c89f8be7d 43
The Other Jimmy 35:da9c89f8be7d 44 def generate(self):
The Other Jimmy 35:da9c89f8be7d 45 libraries = []
The Other Jimmy 35:da9c89f8be7d 46 for lib in self.resources.libraries:
The Other Jimmy 35:da9c89f8be7d 47 l, _ = splitext(basename(lib))
The Other Jimmy 35:da9c89f8be7d 48 libraries.append(l[3:])
The Other Jimmy 35:da9c89f8be7d 49
The Other Jimmy 35:da9c89f8be7d 50 ctx = {
The Other Jimmy 35:da9c89f8be7d 51 'name': self.project_name,
The Other Jimmy 35:da9c89f8be7d 52 'include_paths': self.resources.inc_dirs,
The Other Jimmy 35:da9c89f8be7d 53 'linker_script': self.resources.linker_script,
The Other Jimmy 35:da9c89f8be7d 54 'object_files': self.resources.objects,
The Other Jimmy 35:da9c89f8be7d 55 'libraries': libraries,
The Other Jimmy 35:da9c89f8be7d 56 'symbols': self.toolchain.get_symbols()
The Other Jimmy 35:da9c89f8be7d 57 }
The Other Jimmy 35:da9c89f8be7d 58 ctx.update(self.flags)
The Other Jimmy 35:da9c89f8be7d 59 self.gen_file('codered/%s_project.tmpl' % self.target.lower(), ctx, '.project')
The Other Jimmy 35:da9c89f8be7d 60 self.gen_file('codered/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')