@@ -733,13 +733,17 @@ def link_program(self, r, tmp_path, name):
733733 new_path = join (tmp_path , head )
734734 mkdir (new_path )
735735
736+ # The output file names are derived from the project name, but this can have spaces in it which
737+ # messes-up later processing. Replace any spaces in the derived names with '_'
738+ tail = tail .replace (" " , "_" )
739+
736740 # Absolute path of the final linked file
737741 if self .config .has_regions :
738- elf = join (tmp_path , name + '_application.elf' )
739- mapfile = join (tmp_path , name + '_application.map' )
742+ elf = join (new_path , tail + '_application.elf' )
743+ mapfile = join (new_path , tail + '_application.map' )
740744 else :
741- elf = join (tmp_path , name + '.elf' )
742- mapfile = join (tmp_path , name + '.map' )
745+ elf = join (new_path , tail + '.elf' )
746+ mapfile = join (new_path , tail + '.map' )
743747
744748 objects = sorted (set (r .get_file_paths (FileType .OBJECT )))
745749 config_file = ([self .config .app_config_location ]
@@ -768,21 +772,21 @@ def link_program(self, r, tmp_path, name):
768772 if exists (old_mapfile ):
769773 remove (old_mapfile )
770774 rename (mapfile , old_mapfile )
771- self .progress ("link" , name )
775+ self .progress ("link" , tail )
772776 self .link (elf , objects , libraries , lib_dirs , linker_script )
773777
774778 if self .config .has_regions :
775- filename = "{}_application.{}" .format (name , ext )
779+ filename = "{}_application.{}" .format (tail , ext )
776780 else :
777- filename = "{}.{}" .format (name , ext )
778- full_path = join (tmp_path , filename )
781+ filename = "{}.{}" .format (tail , ext )
782+ full_path = join (new_path , filename )
779783 if ext != 'elf' :
780784 if full_path and self .need_update (full_path , [elf ]):
781- self .progress ("elf2bin" , name )
785+ self .progress ("elf2bin" , tail )
782786 self .binary (r , elf , full_path )
783787 if self .config .has_regions :
784788 full_path , updatable = self ._do_region_merge (
785- name , full_path , ext
789+ tail , full_path , ext
786790 )
787791 else :
788792 updatable = None
@@ -794,7 +798,7 @@ def link_program(self, r, tmp_path, name):
794798 self ._get_toolchain_labels ()
795799 )
796800 if post_build_hook :
797- self .progress ("post-build" , name )
801+ self .progress ("post-build" , tail )
798802 post_build_hook (self , r , elf , full_path )
799803 # Initialize memap and process map file. This doesn't generate output.
800804 self .mem_stats (mapfile )
0 commit comments