Skip to content

Repair the Emblocks exporer and rename to EmBitz #3521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# limitations under the License.

from tools.export import codered, ds5_5, iar, makefile
from tools.export import emblocks, coide, kds, simplicityv3, atmelstudio
from tools.export import embitz, coide, kds, simplicityv3, atmelstudio
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt
from tools.targets import TARGET_NAMES

Expand All @@ -30,7 +30,7 @@
'make_iar': makefile.IAR,
'ds5_5': ds5_5.DS5_5,
'iar': iar.IAR,
'emblocks' : emblocks.IntermediateFile,
'embitz' : embitz.EmBitz,
'coide' : coide.CoIDE,
'kds' : kds.KDS,
'simplicityv3' : simplicityv3.SimplicityV3,
Expand Down
35 changes: 17 additions & 18 deletions tools/export/emblocks.py → tools/export/embitz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from exporters import Exporter
from os.path import splitext, basename
from tools.targets import TARGETS
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter

# filter all the GCC_ARM targets out of the target list
gccTargets = []
for t in TARGETS:
if 'GCC_ARM' in t.supported_toolchains:
gccTargets.append(t.name)

class IntermediateFile(Exporter):
NAME = 'EmBlocks'
class EmBitz(Exporter):
NAME = 'EmBitz'
TOOLCHAIN = 'GCC_ARM'

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

MBED_CONFIG_HEADER_SUPPORTED = True

Expand All @@ -41,10 +35,14 @@ class IntermediateFile(Exporter):
}


@staticmethod
def _remove_symbols(sym_list):
return [s for s in sym_list if not s.startswith("-D")]

def generate(self):
self.resources.win_to_unix()
source_files = []
for r_type, n in IntermediateFile.FILE_TYPES.iteritems():
for r_type, n in self.FILE_TYPES.iteritems():
for file in getattr(self.resources, r_type):
source_files.append({
'name': file, 'type': n
Expand All @@ -71,10 +69,11 @@ def generate(self):
'symbols': self.toolchain.get_symbols(),
'object_files': self.resources.objects,
'sys_libs': self.toolchain.sys_libs,
'cc_org': self.flags['common_flags'] + self.flags['c_flags'],
'ld_org': self.flags['common_flags'] + self.flags['ld_flags'],
'cppc_org': self.flags['common_flags'] + self.flags['cxx_flags']
'cc_org': (self.flags['common_flags'] +
self._remove_symbols(self.flags['c_flags'])),
'ld_org': self.flags['ld_flags'],
'cppc_org': (self.flags['common_flags'] +
self._remove_symbols(self.flags['cxx_flags']))
}

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