Makefile 自动变量之 $(@D),$(@F)

参考:http://www.gnu.org/software/make/manual/make.html

'$(@D)'
The directory part of the file name of the target, with the trailing slash removed. If the value of '$@' is dir/foo.o then '$(@D)' is dir. This value is . if '$@' does not contain a slash.

'$(@D)' 即是目标文件的 目录部分。如果'$@'是 dir/foo.o,那么'$(@D)' 是 dir。如果'$@' 是foo.o,那么'$(@D)'是 当前目录 '.' 。

'$(@F)'
The file-within-directory part of the file name of the target. If the value of '$@' is dir/foo.o then '$(@F)' is foo.o. '$(@F)' is equivalent to '$(notdir $@)'.

'$(@F)'即是目标文件的 文件部分。如果'$@'是 dir/foo.o,那么'$(@F)'是foo.o。

posted @ 2018-04-20 10:24  suonikeyinsu  Views(1312)  Comments(0Edit  收藏  举报