what is $(-*-command-variables-*-)) in gnu make

杀马特。学长 韩版系。学妹 提交于 2021-01-28 17:48:54

问题


In my project makefile, there is a variable named "--command-variables--". I could guess its meaning from the context, but I want to know more about "--command-variables--". No result from google and GNU make manual.

Here is my test makefile,

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

When I type make test=Makefile, it prints out:

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

I found this variables is in .VARIABLES variable, but I can not find it in GNU manual. The version of make I used is GNU make 3.81. Can anyone tell me where does this variables defined in or more about these variables? Thank you.


回答1:


It's one internal variable defined in main.c (line 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);


来源:https://stackoverflow.com/questions/34717403/what-is-command-variables-in-gnu-make

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!