Skip to content

Commit 3a326c0

Browse files
authored
Merge pull request #3521 from theotherjimmy/refurbish-embitz
Repair the Emblocks exporer and rename to EmBitz
2 parents be28fd8 + b8b4131 commit 3a326c0

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

tools/export/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717

1818
from tools.export import codered, ds5_5, iar, makefile
19-
from tools.export import emblocks, coide, kds, simplicityv3, atmelstudio
19+
from tools.export import embitz, coide, kds, simplicityv3, atmelstudio
2020
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt
2121
from tools.targets import TARGET_NAMES
2222

@@ -30,7 +30,7 @@
3030
'make_iar': makefile.IAR,
3131
'ds5_5': ds5_5.DS5_5,
3232
'iar': iar.IAR,
33-
'emblocks' : emblocks.IntermediateFile,
33+
'embitz' : embitz.EmBitz,
3434
'coide' : coide.CoIDE,
3535
'kds' : kds.KDS,
3636
'simplicityv3' : simplicityv3.SimplicityV3,

tools/export/emblocks.py renamed to tools/export/embitz/__init__.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
from exporters import Exporter
1817
from os.path import splitext, basename
19-
from tools.targets import TARGETS
18+
from tools.targets import TARGET_MAP
19+
from tools.export.exporters import Exporter
2020

21-
# filter all the GCC_ARM targets out of the target list
22-
gccTargets = []
23-
for t in TARGETS:
24-
if 'GCC_ARM' in t.supported_toolchains:
25-
gccTargets.append(t.name)
26-
27-
class IntermediateFile(Exporter):
28-
NAME = 'EmBlocks'
21+
class EmBitz(Exporter):
22+
NAME = 'EmBitz'
2923
TOOLCHAIN = 'GCC_ARM'
3024

31-
# we support all GCC targets (is handled on IDE side)
32-
TARGETS = gccTargets
25+
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
26+
if "GCC_ARM" in obj.supported_toolchains]
3327

3428
MBED_CONFIG_HEADER_SUPPORTED = True
3529

@@ -41,10 +35,14 @@ class IntermediateFile(Exporter):
4135
}
4236

4337

38+
@staticmethod
39+
def _remove_symbols(sym_list):
40+
return [s for s in sym_list if not s.startswith("-D")]
41+
4442
def generate(self):
4543
self.resources.win_to_unix()
4644
source_files = []
47-
for r_type, n in IntermediateFile.FILE_TYPES.iteritems():
45+
for r_type, n in self.FILE_TYPES.iteritems():
4846
for file in getattr(self.resources, r_type):
4947
source_files.append({
5048
'name': file, 'type': n
@@ -71,10 +69,11 @@ def generate(self):
7169
'symbols': self.toolchain.get_symbols(),
7270
'object_files': self.resources.objects,
7371
'sys_libs': self.toolchain.sys_libs,
74-
'cc_org': self.flags['common_flags'] + self.flags['c_flags'],
75-
'ld_org': self.flags['common_flags'] + self.flags['ld_flags'],
76-
'cppc_org': self.flags['common_flags'] + self.flags['cxx_flags']
72+
'cc_org': (self.flags['common_flags'] +
73+
self._remove_symbols(self.flags['c_flags'])),
74+
'ld_org': self.flags['ld_flags'],
75+
'cppc_org': (self.flags['common_flags'] +
76+
self._remove_symbols(self.flags['cxx_flags']))
7777
}
7878

79-
# EmBlocks intermediate file template
80-
self.gen_file('emblocks.eix.tmpl', ctx, '%s.eix' % self.project_name)
79+
self.gen_file('embitz/eix.tmpl', ctx, '%s.eix' % self.project_name)
File renamed without changes.

0 commit comments

Comments
 (0)