GNU make manual 翻译( 一百七十五)
繼續翻譯
`.DEFAULT_GOAL' Sets the default goal to be used if no targets were specified onthe command line (*note Arguments to Specify the Goals: Goals.).The `.DEFAULT_GOAL' variable allows you to discover the currentdefault goal, restart the default goal selection algorithm byclearing its value, or to explicitly set the default goal. Thefollowing example illustrates these cases:# Query the default goal.ifeq ($(.DEFAULT_GOAL),)$(warning no default goal is set)endif.PHONY: foofoo: ; @echo $@$(warning default goal is $(.DEFAULT_GOAL))# Reset the default goal..DEFAULT_GOAL :=.PHONY: barbar: ; @echo $@$(warning default goal is $(.DEFAULT_GOAL))# Set our own..DEFAULT_GOAL := fooThis makefile prints:no default goal is setdefault goal is foodefault goal is barfooNote that assigning more than one target name to `.DEFAULT_GOAL' isillegal and will result in an error.`.DEFAULT_GOAL'
設置如果在命令行中沒有制定目的場合,缺省的終點(*note Arguments to Specify the Goals :Goals)。
.DEFAULT_GOAL 變量允許你發現當前的缺省的終點,通過清除它的值來重新設置缺省的終點。下面的例子給出了如何操作:
# Query the default goal.
ifeq ($(.DEFAULT_GOAL),)
$(warning no default goal is set)
endif
.PHONY: foo
foo: ; @echo $@
$(warning default goal is $(.DEFAULT_GOAL))
# Reset the default goal.
.DEFAULT_GOAL :=
.PHONY: bar
bar: ; @echo $@
$(warning default goal is $(.DEFAULT_GOAL))
# Set our own.
.DEFAULT_GOAL := foo
這個 makefile 輸出:
no default goal is set
default goal is foo
default goal is bar
foo
請注意設置多余一個的目的名給`.DEFAULT_GOAL' 是無效的,會造成錯誤。
后文待續
本文轉自健哥的數據花園博客園博客,原文鏈接:http://www.cnblogs.com/gaojian/archive/2012/10/05/2712160.html,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的GNU make manual 翻译( 一百七十五)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mongodb系列01--基础篇
- 下一篇: sql 语言中 when case 用法