mirror of https://github.com/ARMmbed/mbed-os.git
When linking program define the output name based on the OUTPUT_EXT before processing linking the file. This let's any hooks to use the final output file/name.
Omit the dot before the extension for OUTPUT_EXT (all Nordic and Teensy boards);pull/921/head
parent
ca4aaa2dde
commit
f130a80755
|
@ -415,7 +415,7 @@ class K20D50M(Target):
|
|||
self.detect_code = ["0230"]
|
||||
|
||||
class TEENSY3_1(Target):
|
||||
OUTPUT_EXT = '.hex'
|
||||
OUTPUT_EXT = 'hex'
|
||||
|
||||
def __init__(self):
|
||||
Target.__init__(self)
|
||||
|
@ -742,7 +742,7 @@ class NRF51822(Target):
|
|||
'offset' : 0x14000
|
||||
}
|
||||
]
|
||||
OUTPUT_EXT = '.hex'
|
||||
OUTPUT_EXT = 'hex'
|
||||
MERGE_SOFT_DEVICE = True
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -633,6 +633,8 @@ class mbedToolchain:
|
|||
|
||||
def link_program(self, r, tmp_path, name):
|
||||
ext = 'bin'
|
||||
if hasattr(self.target, 'OUTPUT_EXT'):
|
||||
ext = self.target.OUTPUT_EXT
|
||||
|
||||
if hasattr(self.target, 'OUTPUT_NAMING'):
|
||||
self.var("binary_naming", self.target.OUTPUT_NAMING)
|
||||
|
@ -641,7 +643,6 @@ class mbedToolchain:
|
|||
ext = ext[0:3]
|
||||
|
||||
filename = name+'.'+ext
|
||||
|
||||
elf = join(tmp_path, name + '.elf')
|
||||
bin = join(tmp_path, filename)
|
||||
|
||||
|
@ -657,9 +658,6 @@ class mbedToolchain:
|
|||
self.var("compile_succeded", True)
|
||||
self.var("binary", filename)
|
||||
|
||||
if hasattr(self.target, 'OUTPUT_EXT'):
|
||||
bin = bin.replace('.bin', self.target.OUTPUT_EXT)
|
||||
|
||||
return bin
|
||||
|
||||
def default_cmd(self, command):
|
||||
|
|
Loading…
Reference in New Issue