def prepare_target_name(i):
    """
    Input:  {
              host_os_dict   - host OS dict
              target_os_dict - target OS dict
              cus            - custom meta
            }

    Output: {
              return       - return code =  0, if successful
                                         >  0, if error
              (error)      - error text if return > 0

              tool         - tool name
            }

    """

    cus=i['cus']

    hosd=i['host_os_dict']
    tosd=i['target_os_dict']

    hplat=hosd['ck_name']
    tplat=tosd['ck_name']

    tool=''

    sdirs=hosd.get('dir_sep','')

    plat=tplat
    osd=tosd
    if cus.get('soft_file_from_host_os','')=='yes':
       plat=hplat
       osd=hosd

    tool=cus.get('soft_file_universal','')
    if tool=='':
       tool=cus.get('soft_file',{}).get(plat,'')

    file_extensions=hosd.get('file_extensions',{})

    # Check file extensions from OS (for example, to specialize .dylib vs .so for MacOS)
    for k in file_extensions:
        v=file_extensions[k]

        tool=tool.replace('$#file_ext_'+k+'#$',v)

    tool=tool.replace('$#sep#$', sdirs)

    return {'return':0, 'tool':tool}