3 Copyright (c) 2014 ARM Limited
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
9 http://www.apache.org/licenses/LICENSE-2.0
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.
17 from exporters import Exporter
18 from os.path import splitext, basename
21 class CoIDE(Exporter):
57 # seems like CoIDE currently supports only one type
68 self.resources.win_to_unix()
70 for r_type, n in CoIDE.FILE_TYPES.iteritems():
71 for file in getattr(self.resources, r_type):
73 'name': basename(file), 'type': n, 'path': file
76 for r_type, n in CoIDE.FILE_TYPES2.iteritems():
77 for file in getattr(self.resources, r_type):
79 'name': basename(file), 'type': n, 'path': file
83 for lib in self.resources.libraries:
84 l, _ = splitext(basename(lib))
85 libraries.append(l[3:])
87 if self.resources.linker_script is None:
88 self.resources.linker_script = ''
91 'name': self.program_name,
92 'source_files': source_files,
93 'header_files': header_files,
94 'include_paths': self.resources.inc_dirs,
95 'scatter_file': self.resources.linker_script,
96 'library_paths': self.resources.lib_dirs,
97 'object_files': self.resources.objects,
98 'libraries': libraries,
99 'symbols': self.get_symbols()
101 target = self.target.lower()
104 self.gen_file('coide_%s.coproj.tmpl' % target, ctx, '%s.coproj' % self.program_name)