Linux下make命令详解(附:GNU官方教程)

来源:互联网 发布:中学生编程软件 编辑:程序博客网 时间:2024/06/05 16:42


2011/08/04 by Potato

当我们在使用make命令时,常常会在make后面加上其他单词,比如check,install,installcheck…这些单词都是make的参数,我们称之为“目标(targets)”。

最常见的几个目标:

make all:编译程序、库、文档等(等同于make)

make install:安装已经编译好的程序。复制文件树中到文件到指定的位置

make unistall:卸载已经安装的程序。

make clean:删除由make命令产生的文件

make distclean:删除由./configure产生的文件

make check:测试刚刚编译的软件(某些程序可能不支持)

make installcheck:检查安装的库和程序(某些程序可能不支持)

make dist:重新打包成packname-version.tar.gz

 

官方教程的原文:

The words checkinstall, and installcheck, passed as arguments to make, are called targets. makeis a shorthand for make all, all being the default target in the GNU Build System. Here is a list of the most useful targets that the GNU Coding Standards specify.
make all
Build programs, libraries, documentation, etc. (same as make).
make install
Install what needs to be installed, copying the files from the package’s tree to
system-wide directories.
make install-strip
Same as make install, then strip debugging symbols. Some users like to trade
space for useful bug reports. . .
make uninstall
The opposite of make install: erase the installed files. (This needs to be run
from the same build tree that was installed.)
make clean
Erase from the build tree the files built by make all.
make distclean
Additionally erase anything ./configure created.
make check
Run the test suite, if any.
make installcheck
Check the installed programs or libraries, if supported.
make dist Recreate ‘package-version.tar.gz’ from all the source files.

0 0