Skip to content

Commit 4f13e21

Browse files
committed
Use OUTPUT_EXT in managed boot loader
1 parent 1e79439 commit 4f13e21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/build_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ def merge_region_list(region_list, destination, padding=b'\xFF'):
370370
print("Space used after regions merged: 0x%x" %
371371
(merged.maxaddr() - merged.minaddr() + 1))
372372
with open(destination, "wb+") as output:
373-
merged.tofile(output, format='bin')
373+
_, format = splitext(destination)
374+
merged.tofile(output, format=format.strip("."))
374375

375376
def scan_resources(src_paths, toolchain, dependencies_paths=None,
376377
inc_dirs=None, base_path=None, collect_ignores=False):
@@ -512,7 +513,8 @@ def build_project(src_paths, build_path, target, toolchain_name,
512513
region_list = list(toolchain.config.regions)
513514
region_list = [r._replace(filename=res) if r.active else r
514515
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"))
516518
merge_region_list(region_list, res)
517519
else:
518520
res, _ = toolchain.link_program(resources, build_path, name)

0 commit comments

Comments
 (0)