Make 在安装过程中通过 configure、make 和 make install 生成的文件的目录

发布于 2024-08-11 19:35:46 字数 443 浏览 4 评论 0原文

假设我们正在从 GNU 推广的方式分发的源代码中安装一些库。当使用“./configure --prefix”指定安装位置时。

(1) Make 是否在当前目录下生成二进制文件?然后 Make install 是否将它们从当前目录(即运行 Make 的位置)复制到 $prefix ?如果答案是肯定的,我有两个问题,每个问题针对不同的情况。

(2)当当前目录和$prefix不相同时,是否可以将当前目录下Make生成的文件全部删除,以节省一些空间?

(3) 当当前目录和$prefix相同时,make install会什么都不做还是将文件复制到自己?我可以跳过 make install 步骤吗?

Just assume we are installing some libraries from its source distributed by the way GNU promoted. When using "./configure --prefix" to specify where to install.

(1) does Make generate the binaries under the current directory? Does Make install then copies them from the current directory (which is from where Make is run) to $prefix? If the answers are yes, I have two questions, each for different cases.

(2) when the current directory and $prefix are not the same, can I remove all the files generated by Make under current directories to save some space?

(3) when the current directory and $prefix are the same, will make install do nothing or copy the files to themselves? Can I just skip the make install step?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

放肆 2024-08-18 19:35:46

你的第一个问题的答案可能是肯定的。

至于其余的,您可能会发现一个 make clean 它将整理由初始 make 创建的文件。

我认为 makefile 将能够处理当前目录和 $prefix 不同的情况,并做正确的事情。

当前目录通常不是 makefile 创建的文件的目标位置。

(当然这取决于makefile是如何编写的,所以我不能给出明确的答案,但我通常对我使用的makefile印象深刻)

The answer to your first question is probably yes.

As for the rest, you may find a make clean which will tidy up the files created by the initial make.

I think the makefile will be able to handle the situation where current directory and $prefix are not the same, and do the right thing.

The current directory would not usually be the destination of files created by makefiles.

(of course it depends on how the makefile is written, so I can't give definite answers, but I've generally been impressed with the makefiles I've used)

兰花执着 2024-08-18 19:35:46
  1. 你说得完全正确:make只是在当前目录中创建文件,然后make install根据$prefix将其复制到目标目录以及由 configure 脚本维护的其他变量。

  2. 您可以清除运行构建的整个目录。它不会被使用,因为,这就是“安装”的含义:您在一个目录中构建,并且文件被放置在系统的正确位置。

  3. 通常安装目标和您构建的目录不同。正在安装的文件的层次结构通常与构建系统的目录层次结构无关。只需安装到另一个目录:创建另一个目录很便宜。

  1. You are absolutely right: make just creates files in current directory and make install copies it to the destination directories, based on $prefix and other variables maintained by configure script.

  2. You can wipe out the whole directory you've ran the build at. It will not be used, because, well, that's what "install" means: you build in one directory and the the files are placed in the proper places of your system.

  3. Usually install destination and the directory you build in differ. The hierarchy of the files being installed usually do not relate to directory hierarchy of the build system. Just install to the other dir: it's cheap to create just yet another directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文