Linux下make命令详解


当我们在使用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 check, install, and installcheck, passed as arguments to make, are called targets. make is 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.


  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux系统中的make命令是系统管理员和程序员经常使用的命令之一。管理员使用它来编译和安装开源工具,而程序员则使用它来管理复杂项目的编译问题。 在Linux中,许多软件都提供源代码而不是现成的可执行文件。这就要求用户根据自己的系统情况和需求进行配置和编译源代码,才能使用这些软件。而掌握make工具可以帮助我们更好地享受Linux这个自由软件世界带来的乐趣。 然而,让人遗憾的是,许多讲述Linux应用的书籍并没有详细介绍这个功能强大但也非常复杂的编译工具。因此,了解make工具以及其描述文件makefile是非常重要的。Makefile文件可以用来描述项目的编译规则和依赖关系,使得编译过程更加自动化和高效。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [例解LinuxMake命令](https://download.csdn.net/download/weixin_38727453/14889297)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [linux系统make命令详解](https://blog.csdn.net/fuhanghang/article/details/129279257)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值