【问题标题】:what is $(-*-command-variables-*-)) in gnu makegnu make 中的 $(-*-command-variables-*-)) 是什么
【发布时间】:2016-04-15 12:26:03
【问题描述】:

在我的项目makefile中,有一个名为“--command-variables--”的变量。我可以从上下文中猜出它的含义,但我想了解更多关于“--command-variables--”的信息。 google 和 GNU make 手册没有结果。

这是我的测试makefile,

all:
    $(warning $(-*-command-variables-*-))
    #$(warning $(.VARIABLES))
    #$(foreach v, $(.VARIABLES), $(info $v===>$($v)))

当我输入 make test=Makefile 时,它会打印出来:

Makefile:2: test=Makefile
make: `all' is up to date.

我发现这个变量在 .VARIABLES 变量中,但我在 GNU 手册中找不到它。 我使用的 make 版本是 GNU make 3.81。 谁能告诉我这些变量在哪里定义或更多关于这些变量?谢谢。

【问题讨论】:

  • 这是一个用户变量。它一定是在你的 Makefile 中设置的。

标签: variables makefile gnu


【解决方案1】:

它是 main.c 中定义的一个内部变量(第 1344 行),

/* Define an unchangeable variable with a name that no POSIX.2
   makefile could validly use for its own variable.  */
(void) define_variable ("-*-command-variables-*-", 23,value, o_automatic, 0);

【讨论】:

    猜你喜欢
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多