如何在大项目中自动提取小项目所依赖的所有源代码和头文件?

发布于 2025-01-12 12:43:03 字数 294 浏览 5 评论 0原文

小项目是在大项目中进行的。可以用make编译的小项目只使用了这个大项目的一小部分文件。有没有什么工具可以自动提取这个小项目所依赖的所有源代码和头文件?手动挑选当然可行,但效率低下且容易出错,因为 Makefile 非常复杂且嵌套很深。现代IDE通常会构建索引,我不知道是否有IDE提供提取所有依赖项的这种功能。

我最终使用 Process Monitor 工具来跟踪和过滤 Windows 上构建系统的所有 OpenFile 系统调用,然后导出报告并编写脚本来复制文件。但这样的做法不太优雅>_<

A small project is in a big project. The small project that can be compiled with make only uses a small part of the files of this big project. Are there any tools that can automatically extract all the source code and header files that this small project depends on? Manually picking is definitely feasible, but it is inefficient and error-prone since the Makefiles are complex and deeply-nested. Modern IDEs usually build indexes, and I don't know if any IDEs provide this feature of extracting all dependencies.

I ended up using the Process Monitor tool to track and filter all the OpenFile system calls of the build system on Windows, then exported the report and wrote a script to copy the files. But such an approach is not so elegant >_<

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文