def METHOD_NAME(target, shell=True):
    project = target.project
    platform = str(target.tool.name)
    mode = str(target.tool.mode)
    if platform in {"vivado_hls", "vitis_hls"}:
        assert (
            os.system(f"which {platform} >> /dev/null") == 0
        ), f"cannot find {platform} on system path"
        ver = run_process("g++ --version", r"\d\.\d\.\d")[0].split(".")
        assert (
            int(ver[0]) * 10 + int(ver[1]) >= 48
        ), f"g++ version too old {ver[0]}.{ver[1]}.{ver[2]}"
        cmd = f"cd {project}; make "
        if mode == "csim":
            cmd += "csim"
            out = run_process(cmd + " 2>&1")
            runtime = [k for k in out.split("\n") if "seconds" in k][0]
            print(
                f"[{time.strftime('%H:%M:%S', time.gmtime())}] Simulation runtime {runtime}"
            )
        elif "csyn" in mode or mode == "custom" or mode == "debug":
            cmd += platform
            print(
                f"[{time.strftime('%H:%M:%S', time.gmtime())}] Begin synthesizing project ..."
            )
            if shell:
                subprocess.Popen(cmd, shell=True).wait()
            else:
                subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).wait()
            if mode != "custom":
                out = parse_xml(project, "Vivado HLS", top=target.top, print_flag=True)
        else:
            raise RuntimeError(f"{platform} does not support {mode} mode")
    else:
        raise RuntimeError("Not implemented")