上一页 1 ··· 76 77 78 79 80 81 82 83 84 ··· 104 下一页
摘要: 继续翻译`.PRECIOUS' The targets which `.PRECIOUS' depends on are given the following special treatment: if `make' is killed or interrupted during the execution of their recipes, the target is not deleted. *Note Interrupting or Killing `make': Interrupts. Also, if the target... 阅读全文
posted @ 2012-09-21 13:57 健哥的数据花园 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 参考 stackoverflow 的例子:http://stackoverflow.com/questions/5426934/why-this-makefile-removes-my-goal下面的 :%.txt: foo.log #pass%.log: #pass 运行时,用 make a.txt --dry-run, 会得到如下的结果:#pass#passrm foo.log也就是说, 中间文件 foo.log 被删除。但是,如果改为:all: foo.log #pass%.log: #pass这时候,再运行 make --dry-run, 会得到如下的结果:#pass#pas... 阅读全文
posted @ 2012-09-21 13:49 健哥的数据花园 阅读(4486) 评论(0) 推荐(1) 编辑
摘要: 当前目录中存在 gao.g 文件(其实际内容是一个简单的C语言程序)先是用如下的例子来看:例子一.SUFFIXES:.SUFFIXES: .g .oLIBS=gao.oall: $(LIBS)%.o:%g @echo "in %.o:%g"运行结果是: no rule to make target gao.o...也就是说 .SUFFIXES 和 %.o:%g 模式规则一起使用没有效果。再看看如下的例子:把.SUFFIXES 去掉看看,例子二LIBS=gao.oall: $(LIBS)%.o:%g @echo "in %.o:%g"运行结果仍然是:no 阅读全文
posted @ 2012-09-21 10:57 健哥的数据花园 阅读(18095) 评论(0) 推荐(1) 编辑
摘要: 上例子:all:gao @echo "final".DEFAULT: @echo "In default" 由于 gao 是一个前提条件,但是 makefile中没有一个名字为 gao的目的。所以符合 .DEFAULT 目的的执行条件。故执行结果为:In defaultfinal完毕 阅读全文
posted @ 2012-09-20 17:36 健哥的数据花园 阅读(3740) 评论(0) 推荐(0) 编辑
摘要: 继续翻译4.9 Special Built-in Target Names=================================Certain names have special meanings if they appear as targets.`.PHONY' The prerequisites of the special target `.PHONY' are considered to be phony targets. When it is time to consider such a target, `make' will run it. 阅读全文
posted @ 2012-09-20 17:08 健哥的数据花园 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 看例子:LIBS=gao.oall: $(LIBS) @echo "final".c.o: gcc -o $@ $< echo "in .c.o rule"执行 结果:gcc -o gao.o gao.cin .c.o rulefinal注意其中的 .c.o ,其实是 和 %o:%c 等价。是一个旧格式。所以 $@ 对应了 gao.o ,$< 对应了 gao.c ,不要弄反了。 阅读全文
posted @ 2012-09-20 17:01 健哥的数据花园 阅读(7476) 评论(0) 推荐(0) 编辑
摘要: 继续翻译4.8 Empty Target Files to Record Events=======================================The "empty target" is a variant of the phony target; it is used to holdrecipes for an action that you request explicitly from time to time.Unlike a phony target, this target file can really exist; but the fil 阅读全文
posted @ 2012-09-20 16:05 健哥的数据花园 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 继续翻译4.7 Rules without Recipes or Prerequisites==========================================If a rule has no prerequisites or recipe, and the target of the rule isa nonexistent file, then `make' imagines this target to have beenupdated whenever its rule is run. This implies that all targetsdepending 阅读全文
posted @ 2012-09-20 15:44 健哥的数据花园 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 继续翻译Now you can say just `make' to remake all three programs, or specify asarguments the ones to remake (as in `make prog1 prog3'). Phoniness isnot inherited: the prerequisites of a phony target are not themselvesphony, unless explicitly declared to be so. When one phony target is a prerequi 阅读全文
posted @ 2012-09-20 15:29 健哥的数据花园 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 继续翻译 A phony target should not be a prerequisite of a real target file;if it is, its recipe will be run every time `make' goes to update that file. As long as a phony target is never a prerequisite of a real target, the phony target recipe will be executed only when the phony target is a specifi 阅读全文
posted @ 2012-09-20 15:13 健哥的数据花园 阅读(188) 评论(0) 推荐(0) 编辑
上一页 1 ··· 76 77 78 79 80 81 82 83 84 ··· 104 下一页