def METHOD_NAME(source, target, env):
    version = 'v' + str(HASP_VER_MAJ) + '.' + str(HASP_VER_MIN) + '.' + str(HASP_VER_REV) + '_' + get_firmware_commit_hash()
    name =str(target[0]).split(os.path.sep)[2]
    name = name.replace('_4MB', '').replace('_8MB', '').replace('_16MB', '').replace('_32MB', '')
    firmware_src = str(target[0])
    firmware_dst ="{}firmware{}{}_ota_{}.bin".format(OUTPUT_DIR, os.path.sep, name, version)
    # check if output directories exist and create if necessary
    if not os.path.isdir(OUTPUT_DIR):
        os.mkdir(OUTPUT_DIR)
    for d in ['firmware', 'map']:
        if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)):
            os.mkdir("{}{}".format(OUTPUT_DIR, d))
    # check if new target files exist and remove if necessary
    for f in [firmware_dst]:
        if os.path.isfile(f):
            os.remove(f)
    print(firmware_src)
    print(firmware_dst)
    # copy firmware.bin to firmware/<variant>.bin
    shutil.copy(firmware_src, firmware_dst)