|
1 | 1 | """ |
2 | 2 | mbed SDK |
3 | | -Copyright (c) 2011-2013 ARM Limited |
| 3 | +Copyright (c) 2011-2015 ARM Limited |
4 | 4 |
|
5 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | you may not use this file except in compliance with the License. |
|
17 | 17 | from workspace_tools.export.exporters import Exporter |
18 | 18 | import re |
19 | 19 | import os |
| 20 | + |
20 | 21 | class IAREmbeddedWorkbench(Exporter): |
21 | 22 | """ |
22 | 23 | Exporter class for IAR Systems. |
23 | 24 | """ |
24 | 25 | NAME = 'IAR' |
25 | 26 | TOOLCHAIN = 'IAR' |
26 | | - |
27 | | - TARGETS = [ |
28 | | - 'LPC1768', |
29 | | - 'LPC1347', |
30 | | - 'LPC11U24', |
31 | | - 'LPC11U35_401', |
32 | | - 'LPC11U35_501', |
33 | | - #Removed LPCCAPPUCCINO linker file and startup file missing |
34 | | - #'LPCCAPPUCCINO', |
35 | | - 'LPC1114', |
36 | | - 'LPC1549', |
37 | | - 'LPC812', |
38 | | - 'LPC4088', |
39 | | - 'LPC4088_DM', |
40 | | - 'LPC824', |
41 | | - 'UBLOX_C027', |
42 | | - 'ARCH_PRO', |
43 | | - 'K20D50M', |
44 | | - 'KL05Z', |
45 | | - 'KL25Z', |
46 | | - 'KL46Z', |
47 | | - 'K22F', |
48 | | - 'K64F', |
49 | | - 'NUCLEO_F030R8', |
50 | | - 'NUCLEO_F031K6', |
51 | | - 'NUCLEO_F042K6', |
52 | | - 'NUCLEO_F070RB', |
53 | | - 'NUCLEO_F072RB', |
54 | | - 'NUCLEO_F091RC', |
55 | | - 'NUCLEO_F103RB', |
56 | | - 'NUCLEO_F302R8', |
57 | | - 'NUCLEO_F303K8', |
58 | | - 'NUCLEO_F303RE', |
59 | | - 'NUCLEO_F334R8', |
60 | | - 'NUCLEO_F401RE', |
61 | | - 'NUCLEO_F410RB', |
62 | | - 'NUCLEO_F411RE', |
63 | | - 'NUCLEO_F446RE', |
64 | | - 'NUCLEO_L053R8', |
65 | | - 'NUCLEO_L073RZ', |
66 | | - 'NUCLEO_L152RE', |
67 | | - 'NUCLEO_L476RG', |
68 | | - 'DISCO_F429ZI', |
69 | | - 'DISCO_L053C8', |
70 | | - 'DISCO_F334C8', |
71 | | - 'DISCO_F469NI', |
72 | | - 'DISCO_F746NG', |
73 | | - 'DISCO_L476VG', |
74 | | - 'B96B_F446VE', |
75 | | - #'STM32F407', Fails to build same for GCC |
76 | | - 'MAXWSNENV', |
77 | | - 'MAX32600MBED', |
78 | | - 'MTS_MDOT_F405RG', |
79 | | - 'MTS_MDOT_F411RE', |
80 | | - 'MTS_DRAGONFLY_F411RE', |
81 | | - 'NRF51822', |
82 | | - 'NRF51_DK', |
83 | | - 'NRF51_DONGLE', |
84 | | - 'DELTA_DFCM_NNN40', |
85 | | - 'SEEED_TINY_BLE', |
86 | | - 'HRM1017', |
87 | | - 'ARCH_BLE', |
88 | | - 'MOTE_L152RC', |
89 | | - 'EFM32PG_STK3401', |
90 | | - 'RZ_A1H', |
91 | | - ] |
| 27 | + PROGEN_ACTIVE = True |
92 | 28 |
|
93 | 29 | def generate(self): |
94 | | - """ |
95 | | - Generates the project files |
96 | | - """ |
97 | | - sources = [] |
98 | | - sources += self.resources.c_sources |
99 | | - sources += self.resources.cpp_sources |
100 | | - sources += self.resources.s_sources |
101 | | - |
102 | | - iar_files = IarFolder("", "", []) |
103 | | - for source in sources: |
104 | | - iar_files.insert_file(source) |
105 | | - |
106 | | - ctx = { |
107 | | - 'name': self.program_name, |
108 | | - 'include_paths': self.resources.inc_dirs, |
109 | | - 'linker_script': self.resources.linker_script, |
110 | | - 'object_files': self.resources.objects, |
111 | | - 'libraries': self.resources.libraries, |
112 | | - 'symbols': self.get_symbols(), |
113 | | - 'source_files': iar_files.__str__(), |
114 | | - 'binary_files': self.resources.bin_files, |
| 30 | + """ Generates the project files """ |
| 31 | + project_data = self.progen_get_project_data() |
| 32 | + tool_specific = { |
| 33 | + 'iar': { |
| 34 | + 'misc': { |
| 35 | + 'cxx_flags': ['--no_rtti', '--no_exceptions'], |
| 36 | + 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'], |
| 37 | + } |
| 38 | + } |
115 | 39 | } |
116 | | - self.gen_file('iar_%s.ewp.tmpl' % self.target.lower(), ctx, '%s.ewp' % self.program_name) |
117 | | - self.gen_file('iar.eww.tmpl', ctx, '%s.eww' % self.program_name) |
118 | | - self.gen_file('iar_%s.ewd.tmpl' % self.target.lower(), ctx, '%s.ewd' % self.program_name) |
| 40 | + project_data['tool_specific'] = {} |
| 41 | + project_data['tool_specific'].update(tool_specific) |
| 42 | + self.progen_gen_file('iar_arm', project_data) |
119 | 43 |
|
| 44 | +# Currently not used, we should reuse folder_name to create virtual folders |
120 | 45 | class IarFolder(): |
121 | 46 | """ |
122 | 47 | This is a recursive folder object. |
|
0 commit comments