@@ -370,7 +370,8 @@ def merge_region_list(region_list, destination, padding=b'\xFF'):
370
370
print ("Space used after regions merged: 0x%x" %
371
371
(merged .maxaddr () - merged .minaddr () + 1 ))
372
372
with open (destination , "wb+" ) as output :
373
- merged .tofile (output , format = 'bin' )
373
+ _ , format = splitext (destination )
374
+ merged .tofile (output , format = format .strip ("." ))
374
375
375
376
def scan_resources (src_paths , toolchain , dependencies_paths = None ,
376
377
inc_dirs = None , base_path = None , collect_ignores = False ):
@@ -512,7 +513,8 @@ def build_project(src_paths, build_path, target, toolchain_name,
512
513
region_list = list (toolchain .config .regions )
513
514
region_list = [r ._replace (filename = res ) if r .active else r
514
515
for r in region_list ]
515
- res = join (build_path , name ) + ".bin"
516
+ res = "%s.%s" % (join (build_path , name ),
517
+ getattr (toolchain .target , "OUTPUT_EXT" , "bin" ))
516
518
merge_region_list (region_list , res )
517
519
else :
518
520
res , _ = toolchain .link_program (resources , build_path , name )
0 commit comments