mirror of https://github.com/ARMmbed/mbed-os.git
Repair the Emblocks exporer and rename to EmBitz
* Rename because the tool has been renamed * Removed duplicate symbol definitions * Removed common flags from ld flags (common are c/c++ only) * Moved EmBlitz to it's own folderpull/3585/head
parent
92813b9ff6
commit
40eed3d15b
|
@ -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
|
||||
|
||||
|
@ -30,7 +30,7 @@ EXPORTERS = {
|
|||
'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,
|
||||
|
|
|
@ -14,22 +14,16 @@ 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.
|
||||
"""
|
||||
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
|
||||
|
||||
|
@ -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
|
||||
|
@ -71,10 +69,11 @@ class IntermediateFile(Exporter):
|
|||
'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)
|
Loading…
Reference in New Issue