定义:字符串替换函数
格式 :$(subst <from>,<to>,<text>),from替换成to在text中
说明:subst包含三个参数,第一个参数是被替换字串,第二个参数是替换字串,第三个参数是替换操作用的字串。
例1 符号替换:
把$(foo)中的空格替换成逗号,$(bar)的值是 "a,b,c"
comma:= ,
empty:=
space:= $(empty) $(empty)
foo:=a b c
bar:= $(subst $(space),$(comma),$(foo))
例2 字符串替换:
把“ feet on the street”中的“ ee”替换成“ EE”,返回结果是“ fEEt on thestrEEt”
$(subst ee,EE,feet on the street)