开发者

Makefile $@ variable-what is it used for?

开发者 https://www.devze.com 2023-03-08 18:11 出处:网络
I am new to learning make files.I was reading this post. cou开发者_Python百科ld anyone please tell me what is $@ variable used for inside a makefile?The $@ stands for the target of the current rule. M

I am new to learning make files.I was reading this post. cou开发者_Python百科ld anyone please tell me what is $@ variable used for inside a makefile?


The $@ stands for the target of the current rule. More info here.


It's used to refer to the target, for example:

test:
        gcc -o $@ $@.c

Would compile program test from test.c if you ran make test

0

精彩评论

暂无评论...
验证码 换一张
取 消