继续翻译

`.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 翻译( 一百七十五)相关推荐

  1. GNU make manual 翻译( 一百二十四)

    继续翻译 Note that such a prerequisite constitutes mentioning `main.o' in a makefile, so it can never be ...

  2. GNU make manual 翻译( 一百六十)

    继续翻译 The only restriction on this sort of use of nested variable references is that they cannot spec ...

  3. GNU make manual 翻译( 一百六十四)

    继续翻译 When you add to a variable's value with `+=', `make' acts essentially as if you had included th ...

  4. GNU make manual 翻译( 一百六十二)

    继续翻译 6.5 Setting Variables =====================To set a variable from the makefile, write a line st ...

  5. GNU make manual 翻译( 一百八十二)

    继续翻译 `ifdef VARIABLE-NAME' The `ifdef' form takes the _name_ of a variable as its argument, not a re ...

  6. GNU make manual 翻译( 一百五十五)

    继续翻译 6.2 The Two Flavors of Variables ================================There are two ways that a vari ...

  7. GNU make manual 翻译( 一百五十四)

    继续翻译 6.1 Basics of Variable References =================================To substitute a variable's v ...

  8. GNU make manual 翻译( 一百五十九)

    继续翻译 A computed variable name need not consist entirely of a single variable reference. It can conta ...

  9. GNU make manual 翻译( 一百四十九)

    继续翻译 5.7.4 The `--print-directory' Option ------------------------------------If you use several lev ...

最新文章

  1. Bash脚本: 根据关键字做替换
  2. ajax和map返回数据类型,ajax请求后台返回map类型并如何展示
  3. 关闭Struts2中s:property的HTML自动转码
  4. opencv镜像_DX200操作要领—PAM与镜像平移变换(三十八)
  5. APNIC执委赵巍:IPv4向IPv6过渡再无退路
  6. pomelo中的next
  7. mysql hive 内置函数_Hive 内置函数
  8. SpringBoot优点
  9. javascript基础学习一
  10. [development][profile][dpdk] KK程序性能调优
  11. C#LeetCode刷题之#48-旋转图像(Rotate Image)
  12. pass 软件_以信息化为支撑,合理用药为保障,我院 PASS合理用药系统正式上线!...
  13. 大数据之-Hadoop之HDFS_hadoop集群中的安全模式_操作案例---大数据之hadoop工作笔记0075
  14. python与人工智能的关系_广东江门的北大青鸟学校了解到人工智能与Python关系
  15. 拼题a答案c语言计算整数各位数字之和,这是小白刷的基础题,跪求大佬帮忙!!!题目:读入一个自然数n...
  16. rabbitmq 消息持久化
  17. Cannot use v-for on stateful component root element because it renders multiple elements.
  18. matlab 颜色代码 大全_空客 | 红、绿、蓝、白,各类颜色代码的含义
  19. 使用 Amazon Lake Formation 和 Amazon Glue 设计数据网格架构
  20. ESP32 ESP-IDF 获取GPS北斗模块的经纬度和日期时间

热门文章

  1. Python(11):正则表达式
  2. react项目如何按需加载antdDesign组件
  3. 使用axios上传照片
  4. java的poi导出Excel文件
  5. nginx和tomcat之间的简单配置
  6. frame框架点击链接或者按钮跳转整个页面以及别的frame框架
  7. java缓存怎么用_java开发应该如何缓存?
  8. QCwindows server 2003部署
  9. redis desktop manager 连接外网redis服务器
  10. Invokedynamic:Java的秘密武器