摘要:
继续翻译6.10 Variables from the Environment===================================Variables in `make' can come from the environment in which `make' isrun. Every environment variable that `make' sees when it starts up istransformed into a `make' variable with the same name and value.However, 阅读全文
摘要:
继续翻译6.9 Undefining Variables========================If you want to clear a variable, setting its value to empty is usuallysufficient. Expanding such a variable will yield the same result (emptystring) regardless of whether it was set or not. However, if you areusing the `flavor' (*note Flavor Fu 阅读全文
摘要:
上例子foo:=foobar=barall: @echo $(flavor $(foo)) @echo $(flavor $(bar))结果:simplerecursive结束 阅读全文
摘要:
继续翻译 You may nest `define' directives: `make' will keep track of nesteddirectives and report an error if they are not all properly closed with`endef'. Note that lines beginning with the recipe prefix characterare considered part of a recipe, so any `define' or `endef' stringsappe 阅读全文
摘要:
上例子define funcfoo: @echo "at foo"endefall: foo @echo "final"$(eval $(call func, foo,abc.c))先不整那些函数参数传递之类的幺蛾子,做一个个简单的例子,运行 make结果是:at foofinal然后再变化下:define func$1: @echo "at foo"endefall: foo @echo "final"$(eval $(call func, foo,abc.c))这次,传递 foo 作为 $1,得到结果相同。基本 阅读全文
摘要:
上例子reverse=$(2) $(1)foo=$(call reverse, a, b)all: @echo $(foo)运行结果: makeb a结束 阅读全文
摘要:
继续翻译6.8 Defining Multi-Line Variables=================================Another way to set the value of a variable is to use the `define'directive. This directive has an unusual syntax which allows newlinecharacters to be included in the value, which is convenient fordefining both canned sequences 阅读全文
摘要:
上例子override gao=abcgao=12345all: @echo $(gao)运行的结果,makeabcoverride 指令比其他的变量赋值优先级要高。结束 阅读全文
摘要:
上例子override gao += abcall: @echo $(gao)如果执行 make gao=12345结果为:12345 abc直接写gao += abcall: @echo $(gao)执行 make gao=12345结果是:12345当然,如果直接 make,结果就是 abc 了。结束 阅读全文
摘要:
继续翻译6.7 The `override' Directive============================If a variable has been set with a command argument (*note OverridingVariables: Overriding.), then ordinary assignments in the makefile areignored. If you want to set the variable in the makefile even thoughit was set with a command argu 阅读全文