Linux 什么是 makefile - make install
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3915067/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are makefiles - make install
提问by cdxf
I see in Linux these things, but what is it?:
我在 Linux 中看到这些东西,但它是什么?:
./configure
make
make install
etc etc.
等等等等
采纳答案by Oded
make
is part of the build system commonly used in unix type systems - binutils.
make
是 unix 类型系统中常用的构建系统 - binutils 的一部分。
It looks at make files which hold configuration information and build targets.
它查看包含配置信息和构建目标的 make 文件。
Specifically -
具体来说 -
- ./configure - this is a script that sets up the environment for the build
- make - calls
make
with the default build target. Normally builds the app. - make install - calls
make
with theinstall
build target. Normally installs the app.
- ./configure - 这是一个为构建设置环境的脚本
- make -
make
使用默认构建目标进行调用。通常构建应用程序。 - make install -
make
使用install
构建目标调用。通常安装应用程序。
回答by o0'.
configure
checks if you have all the prerequisites/dependencies to build the software.
configure
检查您是否具备构建软件的所有先决条件/依赖项。
make
does the actual compilation.
make
进行实际编译。
make install
installs the software in the correct location.
make install
在正确的位置安装软件。
回答by Justin
Make takes care of running the (sometimes very complex) set of instructions and commands needed to build source control into a compiled executable or library.
Make 负责运行(有时非常复杂)将源代码控制构建到已编译的可执行文件或库中所需的一组指令和命令。
make is a utility that automatically builds executable programs and libraries from source code
make 是一个从源代码自动构建可执行程序和库的实用程序
回答by Erik B
It is basically a build system.
它基本上是一个构建系统。
./configure
checks if you have all the required dependencies and creates the Makefile.make
compiles the software using the rules of the Makefile.make install
moves the software to the correct location in the filesystem.
./configure
检查您是否拥有所有必需的依赖项并创建 Makefile。make
使用 Makefile 的规则编译软件。make install
将软件移动到文件系统中的正确位置。
回答by Paul Tomblin
./configure
is a program that looks at your system configuration and builds some of the system dependencies for your program.
make
is a program that looks at your Makefile
(which was probably built by configure
) and uses the rules in there to build your program. The Makefile
can have multiple "targets" which are rule sets to do different things - the default is usually just to compile and link your program. When you say make
with no arguments, it runs the default target. When you say make install
you're running the install
target, which usually installs the binaries or libraries built by the default target in their final locations. clean
is another common Makefile target that deletes all the generated files like intermediate object files.
./configure
是一个程序,它查看您的系统配置并为您的程序构建一些系统依赖项。
make
是一个程序,它查看您的Makefile
(可能是由 构建的configure
)并使用其中的规则来构建您的程序。该Makefile
可以有多个“目标”,这是规则集做不同的事情-默认的通常只是来编译和链接程序。当你说不make
带参数时,它运行默认目标。当您说make install
您正在运行install
目标时,它通常会在最终位置安装由默认目标构建的二进制文件或库。 clean
是另一个常见的 Makefile 目标,它删除所有生成的文件,如中间目标文件。
回答by Chace Burke
There is also make clean
还有 make clean
Here is a good reference: http://makepp.sourceforge.net/1.19/makepp_tutorial.html
这是一个很好的参考:http: //makepp.sourceforge.net/1.19/makepp_tutorial.html
回答by ldav1s
'./configure' is a shell script that is portable across multiple Unix systems (Linux, Solaris, etc.). './configure' does a few things: test the build environment, fix up portability issues, check for other optional software, check for where you want to install the software package, etc. You can find out what kind of options can be configured by './configure --help'. Just invoking './configure' will just configure the package with whatever it considers default. The main output file from running './configure' is usually a file called 'Makefile' which is the combined build/install/uninstall instructions for the software package.
'./configure' 是一个可在多个 Unix 系统(Linux、Solaris 等)之间移植的 shell 脚本。'./configure' 做了几件事:测试构建环境,修复可移植性问题,检查其他可选软件,检查你想安装软件包的位置等。你可以找出可以配置的选项类型通过'./configure --help'。只需调用 './configure' 只会使用它认为默认的任何内容来配置包。运行“./configure”的主要输出文件通常是一个名为“Makefile”的文件,它是软件包的组合构建/安装/卸载指令。
'make' uses the 'Makefile' to build the default target which is usually the entire collection of things that need to be built.
'make' 使用 'Makefile' 来构建默认目标,它通常是需要构建的整个集合。
'make install' uses the 'Makefile' to build the 'install' target which installs the software.
“make install”使用“Makefile”来构建安装软件的“install”目标。
回答by user2258168
I found this awesome article (Understanding software Installation configure, make, make install) that goes into detail on how configure, make and make install works. Not too shallow and neither too deep, just enough to make one comfortable with Linux installations. http://www.codecoffee.com/tipsforlinux/articles/27.html
我发现了这篇很棒的文章(了解软件安装配置、制作、制作安装),其中详细介绍了配置、制作和制作安装的工作原理。不太浅也不太深,刚好足以让您对 Linux 安装感到满意。http://www.codecoffee.com/tipsforlinux/articles/27.html