对 ar 命令的学习

简介:
学习makefile的写法的时候,遇到了 ar 命令。

进行了学习。下面的网址写得非常好:

http://www.thegeekstuff.com/2010/08/ar-command-examples/

还是通过例子来学习,来得比较快。此文很完美,暂时记录以作备忘。

再回头来 看 makefile 的说法:

复制代码
Archive Members as Targets

An individual member of an archive file can be used as a target or dependency in make. You specify the member named member in archive file archive as follows:

archive(member)
This construct is available only in targets and dependencies, not in commands! Most programs that you might use in commands do not support this syntax and cannot act directly on archive members. Only ar and other programs specifically designed to operate on archives can do so. Therefore, valid commands to update an archive member target probably must use ar. For example, this rule says to create a member `hack.o' in archive `foolib' by copying the file `hack.o':

foolib(hack.o) : hack.o
        ar cr foolib hack.o
In fact, nearly all archive member targets are updated in just this way and there is an implicit rule to do it for you. Note: The `c' flag to ar is required if the archive file does not already exist.

To specify several members in the same archive, you can write all the member names together between the parentheses. For example:

foolib(hack.o kludge.o)
is equivalent to:

foolib(hack.o) foolib(kludge.o)
You can also use shell-style wildcards in an archive member reference. See section Using Wildcard Characters in File Names. For example, `foolib(*.o)' expands to all existing members of the `foolib' archive whose names end in `.o'; perhaps `foolib(hack.o) foolib(kludge.o)'.
复制代码

本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/18/2690629.html,如需转载请自行联系原作者

目录
相关文章
|
Linux vr&ar 开发者
Linux 命令 `ar` 详解:静态库的管理利器
`ar` 命令是 Linux 管理静态库的工具,常用于创建、修改和提取 `.a` 文件。基本语法为 `ar [选项] 目标文件 [成员...]`。常用选项包括:`rcs` 创建(更新)静态库,`t` 列出成员,`x` 提取成员,`d` 删除成员。注意文件顺序、创建索引、备份和跨平台兼容性。学习和掌握 `ar` 命令能提升系统开发效率。
|
Shell Linux vr&ar
【Shell 命令集合 备份压缩 】⭐⭐⭐Linux 修改备存/静态库 文件 ar命令 使用指南
【Shell 命令集合 备份压缩 】⭐⭐⭐Linux 修改备存/静态库 文件 ar命令 使用指南
180 0
|
存储 vr&ar C#
Unity学习4:如何实现2D图像跟踪(涂色类AR项目实践1)
AR tracked image manager(2D图像检测追踪管理器)
545 0
Unity学习4:如何实现2D图像跟踪(涂色类AR项目实践1)
|
Unix Linux vr&ar
AIX与Linux中的ar命令
下面是man手册中查询的命令或文件等会有一个括号,括号内通常有一个数字,如下图,ar的后面就有一个数字1: 各数字代表的具体含义如下: 代号 代表内容 1     使用者可以操作的指令或可执行文件 2     系统核心可调用的函数与工具等 3     一些常用的...
1291 0
|
Linux Shell vr&ar
linux 管理小命令2——cd,basename,file,locate,ar,which和whereis,banner,finger
1、cd: cd 大家都知道怎么用,但是有三个选项大家可能不是很清楚,' -'    '-L'    ' -P ' 这三个选项,具体什么意思呢?是这个样子滴:这几个选项是跟连接具体相关的,比如你给/home/liu/yg/liy2 目录下的目录lyg1这个目录建立了一个连接 名字叫liu ,那么当你在/home/liu/yg/liy2 目录下输入: cd -P  liu 的时候,就进入了你原来的目录:/home/liu/yg/liy2/lyg1里面了。
1369 0
|
3月前
|
人工智能 JavaScript vr&ar
眼镜不是“玩具”,是下一个时代的入口:聊聊VR和AR的未来走向
眼镜不是“玩具”,是下一个时代的入口:聊聊VR和AR的未来走向
100 5
|
人工智能 编解码 5G
虚拟现实(VR)与增强现实(AR)的融合:开启全新交互时代
【6月更文挑战第17天】虚拟现实(VR)与增强现实(AR)融合成混合现实(MR),打造全新交互体验。MR结合VR的沉浸感和AR的现实增强,应用于教育、游戏、设计和营销,带来创新教学方式、沉浸式游戏体验和高效设计工具。尽管面临技术挑战,随着5G和AI的发展,MR有望引领未来交互的革命。
|
传感器 数据可视化 安全
【虚拟现实】二、主要的AR/VR硬件设备
【虚拟现实】二、主要的AR/VR硬件设备
469 3