摘要:
objects = foo.o bar.oall: $(objects)$(objects): %.o : %.c $(CC) -c $< -o $@$(objects): %.o : %.c 表示, 每个.o 文件依赖于 同名的 .c 文件。 阅读全文
摘要:
继续翻译4.11 Multiple Rules for One Target==================================One file can be the target of several rules. All the prerequisitesmentioned in all the rules are merged into one list of prerequisites forthe target. If the target is older than any prerequisite from any rule,the recipe is exe.. 阅读全文
摘要:
继续翻译4.10 Multiple Targets in a Rule===============================A rule with multiple targets is equivalent to writing many rules, eachwith one target, and all identical aside from that. The same recipeapplies to all the targets, but its effect may vary because you cansubstitute the actual target . 阅读全文
摘要:
继续翻译`.ONESHELL' If `.ONESHELL' is mentioned as a target, then when a target is built all lines of the recipe will be given to a single invocation of the shell rather than each line being invoked separately (*note Recipe Execution: Execution.).`.POSIX' If `.POSIX' is mentioned as ... 阅读全文
摘要:
需要声明的是 gnu make 的 3.81 中尚未包含 .ONESHELL 功能。3.82 中方有此功能。如下的例子是在安装了 gnu make 3.82 后验证成功的:上例子:#.NOTPARALLEL:#.ONESHELL:.SECONDEXPANSION:.PHONY: allall: a a: t1=abc;export t1 @echo $$t1;此时,make 的结果显示:t1=abc; export t1而把 .ONESHELL 前面的注释去掉后,#.NOTPARALLEL:.ONESHELL:.SECONDEXPANSION:.PHONY: alla... 阅读全文
摘要:
运行yum 的时候,如果出现 Another app is currently holding the yum lock...之类,要运行 :rm -f /var/run/yum.pid。 阅读全文
摘要:
上例子事先准备好三个脚本:a01.sh b01.sh c01.sh:脚本内容如下, 即每睡眠一秒钟后再输出内容:a01.shfor ((i=0;i<10;i++));do @echo "a01..." $i; sleep 1;done;b01.shfor ((i=0;i<10;i++));do @echo "b01..." $i; sleep 1;done;c01.shfor ((i=0;i<10;i++));do @echo "c01..." $i; sleep 1;done;makefile 的内容如下:.PHO 阅读全文
摘要:
继续翻译`.NOTPARALLEL' If `.NOTPARALLEL' is mentioned as a target, then this invocation of `make' will be run serially, even if the `-j' option is given. Any recursively invoked `make' command will still run recipes in parallel (unless its makefile also contains this target). Any pr. 阅读全文
摘要:
为了学习 .EXPORT_ALL_VARIABLES ,查阅了如下的文章:http://blog.csdn.net/zplove003/article/details/7066595这个文章写得很棒,演示了makefile 的嵌套调用。这里我把其中的 顶层 Makefile改一下,用 .EXPORT_ALL_VARIABLES 来代替。//顶层目录下的Makeflie文件cc=gcc SUBD... 阅读全文
摘要:
继续翻译`.EXPORT_ALL_VARIABLES' Simply by being mentioned as a target, this tells `make' to export all variables to child processes by default. *Note Communicating Variables to a Sub-`make': Variables/Recursion.通过简单地声明 .EXPORT_ALL_VARIABLES ,可以告诉 make 来到出所有的变量给 子进程。*Note Communicating Varia. 阅读全文
摘要:
继续翻译`.SILENT' If you specify prerequisites for `.SILENT', then `make' will not print the recipe used to remake those particular files before executing them. The recipe for `.SILENT' is ignored. If mentioned as a target with no prerequisites, `.SILENT' says not to print any recipe 阅读全文
摘要:
继续翻译`.LOW_RESOLUTION_TIME' If you specify prerequisites for `.LOW_RESOLUTION_TIME', `make' assumes that these files are created by commands that generate low resolution time stamps. The recipe for the `.LOW_RESOLUTION_TIME' target are ignored. The high resolution file time stamps of 阅读全文
摘要:
上例子:.IGNORE: gao.3LIBS =gao.1 gao.2 gao.3all:$(LIBS) @echo finalgao.1: gao.2 @echo gao.1gao.2: gao.3 ./me.o @echo gao.2gao.3: @echo gao.3运行结果:gao.3./me.ohellomake:***[gao.2] Error 2此时由于仅忽略 gao.3 中的错误,所以在 gao.2 中失败退出了。结束 阅读全文