2016-04-12 08:52:14 +00:00
|
|
|
"""
|
|
|
|
mbed SDK
|
2016-07-26 20:30:59 +00:00
|
|
|
Copyright (c) 2011-2016 ARM Limited
|
2016-04-12 08:52:14 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
"""
|
2018-02-21 15:43:19 +00:00
|
|
|
from os import remove
|
2017-08-22 15:13:13 +00:00
|
|
|
from tools.export.gnuarmeclipse import GNUARMEclipse
|
2016-04-12 08:52:14 +00:00
|
|
|
|
2017-08-22 15:13:13 +00:00
|
|
|
class E2Studio(GNUARMEclipse):
|
2016-04-12 08:52:14 +00:00
|
|
|
NAME = 'e2 studio'
|
|
|
|
TOOLCHAIN = 'GCC_ARM'
|
|
|
|
|
|
|
|
TARGETS = [
|
|
|
|
'RZ_A1H',
|
2017-09-08 09:23:09 +00:00
|
|
|
'VK_RZ_A1H',
|
2018-01-16 04:30:31 +00:00
|
|
|
'GR_LYCHEE',
|
2016-04-12 08:52:14 +00:00
|
|
|
]
|
|
|
|
|
2017-08-22 15:13:13 +00:00
|
|
|
# override
|
2016-04-12 08:52:14 +00:00
|
|
|
def generate(self):
|
2017-08-22 15:13:13 +00:00
|
|
|
|
2017-12-05 16:01:15 +00:00
|
|
|
jinja_ctx = self.create_jinja_ctx()
|
2017-08-22 15:13:13 +00:00
|
|
|
|
|
|
|
self.gen_file('e2studio/.cproject.tmpl', jinja_ctx, '.cproject', trim_blocks=True, lstrip_blocks=True)
|
|
|
|
self.gen_file('e2studio/.gdbinit.tmpl', jinja_ctx, '.gdbinit')
|
2018-01-23 16:58:17 +00:00
|
|
|
self.gen_file('e2studio/launch5x.tmpl', jinja_ctx, '%s OpenOCD 5x.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)
|
2017-08-22 15:13:13 +00:00
|
|
|
self.gen_file('e2studio/launch.tmpl', jinja_ctx, '%s OpenOCD.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)
|
|
|
|
|
|
|
|
self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx, '.project', trim_blocks=True, lstrip_blocks=True)
|
2018-02-16 19:46:26 +00:00
|
|
|
self.gen_file_nonoverwrite('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')
|
2017-08-22 15:13:13 +00:00
|
|
|
self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx, 'makefile.targets', trim_blocks=True, lstrip_blocks=True)
|
2018-02-21 15:43:19 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def clean(project_name):
|
|
|
|
remove('%s OpenOCD 5x.launch' % project_name)
|
|
|
|
remove('%s OpenOCD.launch' % project_name)
|