|
28 | 28 | from os.path import splitext, basename, exists
|
29 | 29 | from random import randint
|
30 | 30 |
|
31 |
| -from tools.export.gnuarmeclipse import GNUARMEclipse |
| 31 | +from tools.export.gnuarmeclipse import GNUARMEclipse, UID |
32 | 32 | from tools.export.exporters import apply_supported_whitelist
|
33 | 33 | from tools.targets import TARGET_MAP
|
34 | 34 | from tools.utils import NotSupportedException
|
|
38 | 38 | # =============================================================================
|
39 | 39 |
|
40 | 40 |
|
41 |
| -class UID: |
42 |
| - """ |
43 |
| - Helper class, used to generate unique ids required by .cproject symbols. |
44 |
| - """ |
45 |
| - @property |
46 |
| - def id(self): |
47 |
| - return "%0.9u" % randint(0, 999999999) |
48 |
| - |
49 |
| -# Global UID generator instance. |
50 |
| -# Passed to the template engine, and referred as {{u.id}}. |
51 |
| -# Each invocation generates a new number. |
52 |
| -u = UID() |
53 |
| - |
54 |
| -# ============================================================================= |
55 |
| - |
56 |
| - |
57 | 41 | POST_BINARY_WHITELIST = set([
|
58 | 42 | "TEENSY3_1Code.binary_hook",
|
59 | 43 | "MCU_NRF51Code.binary_hook",
|
@@ -201,13 +185,12 @@ def generate(self):
|
201 | 185 | opts['ld']['object_files'] = objects
|
202 | 186 | opts['ld']['user_libraries'] = self.libraries
|
203 | 187 | opts['ld']['system_libraries'] = self.system_libraries
|
204 |
| - # opts['ld']['script'] = join(id.capitalize(), |
205 |
| - # "linker-script-%s.ld" % id) |
206 | 188 | opts['ld']['script'] = self.ld_script
|
207 | 189 | opts['cpp_cmd'] = " ".join(toolchain.preproc)
|
208 | 190 |
|
209 | 191 | # Unique IDs used in multiple places.
|
210 | 192 | # Those used only once are implemented with {{u.id}}.
|
| 193 | + u = UID() |
211 | 194 | uid = {}
|
212 | 195 | uid['config'] = u.id
|
213 | 196 | uid['tool_c_compiler'] = u.id
|
@@ -235,8 +218,6 @@ def generate(self):
|
235 | 218 | '.project', trim_blocks=True, lstrip_blocks=True)
|
236 | 219 | self.gen_file('mcuxpresso/{0}_cproject.tmpl'.format(target_name), jinja_ctx,
|
237 | 220 | '.cproject', trim_blocks=True, lstrip_blocks=True)
|
238 |
| -# self.gen_file('mcuxpresso/makefile.targets.tmpl', jinja_ctx, |
239 |
| -# 'makefile.targets', trim_blocks=True, lstrip_blocks=True) |
240 | 221 | self.gen_file('mcuxpresso/mbedignore.tmpl', jinja_ctx, '.mbedignore')
|
241 | 222 |
|
242 | 223 | print
|
|
0 commit comments