me
me copied to clipboard
学习 C/C++ (Part 21: makefile wildcard and function)
关键变量:
-
$@
目标文件 -
$<
依赖目标中的第一个目标,如果依赖以(%)模式定义,则一个一个取出来的 -
$^
所有依赖目标的集合 -
$?
所有有更新的依赖目标集合 -
$(@D)
$@的目录部分 -
$(@F)
$@的文件部分
关键函数
-
$(subst <from>,<to>,<text>)
-
$(patsubst <pattern>,<replacement>,<text>)
-
$(strip <string>)
-
$(find string <find>,<in>)
-
$(filter <pattern...>,<text>)
-
$(shell command)