Makefile 知识点

[email protected]

[email protected] is the name of the target.

$?

The $? macro stores the list of dependents more recent than the target (i.e., those that have changed since the last time make was invoked for the given target).

$^

$^ gives you all dependencies, regardless of whether they are more recent than the target. Duplicate names, however, will be removed. This might be useful if you produce transient output (such as displaying a result to the screen rather than saving it to a file).

$+

$+ is like $^, but it keeps duplicates and gives you the entire list of dependencies in the order they appear.

$<

If you only need the first dependency, then $< is for you. Using $< can be safer than relying on $^ when you have only a single dependency that needs to appear in the commands executed by the target. If you start by using $^ when you have a single dependency, if you then add a second, it may be problematic, whereas if you had used $< from the beginning, it will continue to work. (Of course, you may want to have all dependencies show up. Consider your needs carefully.)

Makefile 知识点

时间: 2024-08-05 09:22:09

Makefile 知识点的相关文章

makefile知识点总结

Makefile变量 $^         所有的依赖目标的集合,以空格分隔 [email protected]        表示规则中的目标文件集 $?          所有比目标新的依赖目标的集合,以空格分隔 $<         依赖目标中的第一个目标名字.如果依赖目标是以模式(即"%")定义的,那么"$<"将是符合模式的一系列的文件集.注意,其是一个一个取出来的. $(@D)   表示"[email protected]"

uboot学习之二----主Makefile学习之三----静默编译

第45-54行: 45 # Deal with colliding definitions from tcsh etc. 46 VENDOR= 47 48 ######################################################################### 49 # Allow for silent builds 50 ifeq (,$(findstring s,$(MAKEFLAGS))) //判断findstring函数是否为空 51 XECHO

要善于总结,实践,才有出路

1.之前对pjsip会话状态机,voip skeleton,Email Server和iptable,nginx等程序的总结不够,没有形成清晰的认识 2.对学过的shell,makefile知识点要写好总结,以免以后用到能够快速地学习 3.对学过的算法(快排,堆,合并,希尔,二叉树的遍历等)和数据结构(平衡二叉树,红黑树等), 要时时复习,多点写代码测试 4.之前做过的<深入理解操作系统>的几个lab,要不断地完善,学习 6.总结来自学习和实践,总结出来的精华用来指导实践和学习 7.简历要凝练

关于makefile中的知识点&lt;不断补充&gt;

=        make会将整个makefile展开后,再决定变量的值.也就是说,变量的值将会是整个makefile中最后被指定的值.:=       表示变量的值决定于它在makefile中的位置,而不是整个makefile展开后的最终值.?=      是如果没有被赋值过就赋予等号后面的值+=      是添加等号后面的值 [email protected]      目标文件 $^      所有的依赖文件 $<      第一个依赖文件.

Makefile 7——自动生成依赖关系 三颗星

后面会介绍gcc获得源文件依赖的方法,gcc这个功能就是为make而存在的.我们采用gcc的-MM选项结合sed命令.使用sed进行替换的目的是为了在目标名前加上"objs/"前缀.gcc的-E选项,预处理.在生成依赖关系时,其实并不需要gcc编译源文件,只要预处理就可以获得依赖关系了.通过-E选项,可以避免生成依赖关系时gcc发出警告,以及提高依赖关系的生成效率. 现在,已经找到自动生成依赖关系的方法了,那么如何将其整合到我们complicated项目的Makefile中呢?自动生成

Contiki 2.7 Makefile 文件(二)

二.Makefile.include 1.第一部分 (1) ifndef CONTIKI ${error CONTIKI not defined! You must specify where Contiki resides} endif 含义: 如果没有定义CONTIKI变量,make停止运行. 并产生一个致命的错误信息,CONTIKI not  defined! You must specify where Contiki resides. hello-world这个例子在主控Makefil

Linux Kernel Makefile简析 之 make zImage

本文将简要分析Linux Kernel编译zImage的过程.读者需具备GNU Make.Bash Shell.Python脚 本.编译器.链接器等方面的基础知识.虽然重点是分析kernel的构建过程,但是也会顺带的分析一些 其他的小的知识点.我们坐车去远行,欣赏沿途的风景,并不会妨碍我们最终抵达我们的目的地,不是 吗? 先描述一下具体开发环境: . host os: ubuntu 14.04 server LTS . cross toolchain: crosstool-ng生成的交叉编译器

补基础之shell 和makefile

2.2.1.shell介绍 (1)shell可以理解为软件系统提供给用户操作的命令行界面,可以说他是人机交互的一种方式 (2)我们可以使用shell和操作系统.uboot等软件系统进行交互.具体来说就是我们通过shell给软件系统输入命令,然后回车执行,执行完后会回到shell命令行再次输入命令执行 (3)我们上述的操作方式一般情况下工作很好,但是有一个缺陷.譬如我们要在linux 下创建一个文件a.c,可以touch a.c,但是如果我现在要在linux下创建100个文件,分别是a1.c  a

粗浅谈论makefile

主要参考:跟我一起写makefile  点击打开链接 Makefile简介: 简单的说,一个大的工程中的源文件不计其数,其按照不同的类型,功能,模块放在了不同的目录之中,makefile则是定义了一些规则来指定,哪些文件需要先编译,哪些需要后编译,哪些需要重新编译,而makefile带来的好处就是,一旦写好,之后一个make命令 就可以搞定,极大的提高了软件的开发. 简述编译链接: 无论选择什么语言c,c++都需要将源文件编译成为中间代码文件,在windows下面是.obj文件,而unix则是.