Makefile的函数使用.md

wildcard

使通配符生效场景

在Makefile规则中,通配符会被自动展开。但在变量的定义和函数引用时,通配符将失效。

$(wildcard <PATTERN…>)

patsubst

patsubst函数返回被替换过后的字符串。

$(patsubst ,,)

define

1
2
3
4
5
6
7
8
9
10
11
define fun1
@echo "My name is $(0)"
endef
define fun2
@echo "My name is $(0), param is $(1)"
@echo "My name is $(0)"
endef

define fun2
@echo "My name is $(0), param is $(1)"
enddef

Makefile的函数使用.md
https://abrance.github.io/2023/12/27/mdstorage/domain/makefile/Makefile的函数使用/
Author
xiaoy
Posted on
December 27, 2023
Licensed under