def METHOD_NAME(
        use_c: bool = True,
        use_cxx: bool = True,
        ignore_prefix_list: Optional[List[str]] = None,
) -> List[Tuple[str, List[str], List[str]]]:
    makelog = makefile_log()
    source = []
    compilers = []
    if use_c:
        compilers.append(cmake_cache_var_or_exit("CMAKE_C_COMPILER"))
    if use_cxx:
        compilers.append(cmake_cache_var_or_exit("CMAKE_CXX_COMPILER"))
    print("compilers:", " ".join(compilers))
    fake_compiler = "%COMPILER%"
    print("parsing make log ...")
    for line in makelog:
        args: Union[str, List[str]] = line.split()
        if not any([(c in args) for c in compilers]):
            continue
        # join args incase they are not.
        args = ' '.join(args)
        args = args.replace(" -isystem", " -I")
        args = args.replace(" -D ", " -D")
        args = args.replace(" -I ", " -I")
        for c in compilers:
            args = args.replace(c, fake_compiler)
        args = shlex.split(args)
        # end
        # remove compiler
        args[:args.index(fake_compiler) + 1] = []
        c_files = [f for f in args if is_c(f)]
        inc_dirs = [f[2:].strip() for f in args if f.startswith('-I')]
        defs = [f[2:].strip() for f in args if f.startswith('-D')]
        for c in sorted(c_files):
            if do_ignore(c, ignore_prefix_list):
                continue
            source.append((c, inc_dirs, defs))
        # make relative includes absolute
        # not totally essential but useful
        for i, f in enumerate(inc_dirs):
            if not os.path.isabs(f):
                inc_dirs[i] = os.path.abspath(os.path.join(CMAKE_DIR, f))
        # safety check that our includes are ok
        for f in inc_dirs:
            if not os.path.exists(f):
                raise Exception("%s missing" % f)
    print("done!")
    return source