从 Make 输出创建对象层次结构?
make -d 和 make -p 提供了有用的信息,但我需要 JSON 格式的信息,这样我就可以递归地枚举哪些库来自哪些源文件。有没有办法做到这一点(无论如何,大约接近)?或者有可用的自定义工具吗?我搜遍了 Intarwebs,但我的搜索毫无结果。感谢您的帮助!
注意:我正在寻找类似于 sysconfig.parse_makefile 的东西。事实上,它所做的与我正在寻找的非常接近,只是它仅对用于构建 Python 的隐式 Makefile 有用。有什么指点吗?
make -d and make -p provide useful information, but I need this in JSON format, so I can enumerate what libraries came from which source files, recursively. Is there a way to do this already (approximately close, anyhow)? Or is there a custom tool available? I've scoured the Intarwebs, and my search has come up dry. Thank you for any help!
Note: I'm looking for something that's similar to sysconfig.parse_makefile. In fact, what that does is pretty close to what I'm looking for, except that it's only useful for the implicit Makefile that is used to build Python. Any pointers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不是 JSON,而是 Perl CPAN 模块 Makefile:: GraphViz 从 makefile 创建依赖图的可视化。如果 JSON 确实是您想要的,您可能可以捕获生成的“点”依赖文件并将其相当轻松地转换为 JSON。
It's not JSON, but the Perl CPAN module Makefile::GraphViz creates visualizations of the dependency graph from a makefile. If JSON is really what you want, you could probably capture the 'dot' dependency file that is generated and convert it to JSON fairly easily.