zoukankan      html  css  js  c++  java
  • GNU make manual 翻译( 一百七十四)

    继续翻译

    6.14 Other Special Variables
    ============================
    
    GNU `make' supports some variables that have special properties.
    
    `MAKEFILE_LIST'
         Contains the name of each makefile that is parsed by `make', in
         the order in which it was parsed.  The name is appended just
         before `make' begins to parse the makefile.  Thus, if the first
         thing a makefile does is examine the last word in this variable, it
         will be the name of the current makefile.  Once the current
         makefile has used `include', however, the last word will be the
         just-included makefile.
    
         If a makefile named `Makefile' has this content:
    
              name1 := $(lastword $(MAKEFILE_LIST))
    
              include inc.mk
    
              name2 := $(lastword $(MAKEFILE_LIST))
    
              all:
                      @echo name1 = $(name1)
                      @echo name2 = $(name2)
    
         then you would expect to see this output:
    
              name1 = Makefile
              name2 = inc.mk

    6.14 其他的特殊变量
    ============================

    GNU make 支持某些拥有特殊属性的变量

    `MAKEFILE_LIST'

    包含被make 解析的每一个makefile的名字,按照其被解析的顺序来罗列。在make 开始解析makefile之前,makefile的名字被追加近来。因此如果一个makefile所作的第一件事情是检查此变量中的最后一个单词,那么它将是当前的makefile。当当前的makefile使用了 include,那么最后一个单词将会是被包含的makefile的名字。

    如果一个名为`Makefile' 的makefile包含了如下的内容:

    name1 := $(lastword $(MAKEFILE_LIST))

    include inc.mk

    name2 := $(lastword $(MAKEFILE_LIST))

    all:
    @echo name1 = $(name1)
    @echo name2 = $(name2)

    那么,你将要看到如下的输出:

    name1 = Makefile
    name2 = inc.mk

    后文待续

  • 相关阅读:
    在Ubuntu下安装软件
    HIVE Thrift Server使用总结
    用Wubi来安装Ubuntu 12
    linux命令总结
    Linux Sed简介
    Linux批量重命名文件
    算法学习的轨迹(转)
    写入es速率优化
    走近Flex组件系列(三):按扭组件(Button,CheckBox,LinkBar,LinkButton,PopUpButton,RadioButton,ToggleButtonBar)
    走近Flex组件系列(二):简单实用的Alert组件
  • 原文地址:https://www.cnblogs.com/gaojian/p/2712151.html
Copyright © 2011-2022 走看看