如何检查 makefile 的依赖关系?
我正在尝试使用以下命令安装某些内容:
make world
这需要很长时间,并且通常会出现错误,提示我缺少某种软件包。我找到了这个包是什么,安装了它,然后再次运行它,很长一段时间后才发现我缺少另一个包。有没有办法找到我需要安装的所有软件包,而不必经历这个过程?
I'm trying to install something with the following command:
make world
It takes a long time, and usually it ends up with an error saying that I'm missing some kind of package. I found out what the package is, install it, and run the thing again, only to find out after a long time that I'm missing another package. Is there a way to find out all the packages I need to install without having to go through this process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这通常是配置脚本的作用。如果您正在构建的项目没有,您应该编写一个< /a>.
This is generally what the configure script does. If the project you're building doesn't have one, you should write one.
处理依赖关系的最佳方法是使用包管理器,例如:
如果使用包管理器安装软件,它将根据需要自动获取、下载和安装任何依赖关系。这些包管理器支持大量流行的开源项目,但并非所有项目都受支持。其中一些包管理器支持创建自定义包存储库,这也允许它们用于内部依赖关系管理。
不幸的是,没有通用的方法来获取 Makefile 的所有库依赖项(缺少 grep 的“lib”、“.so”和“-l”,这可能会给您带来虚假结果);但是,如果您要安装开源项目,则很可能您系统上的包管理器支持它。
The best way to deal with dependencies is with a package manager such as:
If you install software with a package manager, it will automatically fetch, download, and install any dependencies as necessary. These package managers support a huge number of popular open source projects, but not all projects are supported. Some of these package managers support creating custom package repositories, which allows them to be used for dependency management in-house, as well.
Unfortunately, there is no general way to get all the library dependencies of a Makefile (short of grepping for "lib", ".so", and "-l" which may give you spurious results); however, if you are installing an open source project, chances are that it is supported by a package manager on your system.