14
14
See the License for the specific language governing permissions and
15
15
limitations under the License.
16
16
"""
17
- from exporters import Exporter
18
17
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
20
20
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'
29
23
TOOLCHAIN = 'GCC_ARM'
30
24
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 ]
33
27
34
28
MBED_CONFIG_HEADER_SUPPORTED = True
35
29
@@ -41,10 +35,14 @@ class IntermediateFile(Exporter):
41
35
}
42
36
43
37
38
+ @staticmethod
39
+ def _remove_symbols (sym_list ):
40
+ return [s for s in sym_list if not s .startswith ("-D" )]
41
+
44
42
def generate (self ):
45
43
self .resources .win_to_unix ()
46
44
source_files = []
47
- for r_type , n in IntermediateFile .FILE_TYPES .iteritems ():
45
+ for r_type , n in self .FILE_TYPES .iteritems ():
48
46
for file in getattr (self .resources , r_type ):
49
47
source_files .append ({
50
48
'name' : file , 'type' : n
@@ -71,10 +69,11 @@ def generate(self):
71
69
'symbols' : self .toolchain .get_symbols (),
72
70
'object_files' : self .resources .objects ,
73
71
'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' ]))
77
77
}
78
78
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 )
0 commit comments