三鼎网络网站建设,怀化市建设局网站地址,百度的网址是什么,二手车网站源码下载文章目录 1、makefile函数1.1、字符串替换函数#xff1a;subst1.2、模式字符串替换函数#xff1a;patsubst1.3、去空格函数#xff1a;strip1.4、查找字符串函数#xff1a;findstring 2、、:、#xff1f;区别 1、makefile函数
1.1、字符串替换函数#xff1a;subst … 文章目录 1、makefile函数1.1、字符串替换函数subst1.2、模式字符串替换函数patsubst1.3、去空格函数strip1.4、查找字符串函数findstring 2、、:、区别 1、makefile函数
1.1、字符串替换函数subst
函数原型 $(subst from,to,text) 名称 字符串替换函数——subst。 功能 把字串text中的from字符串替换成to。 返回 函数返回被替换过后的字符串。
1.2、模式字符串替换函数patsubst
函数原型 $(patsubst pattern,replacement,text) 功能 查找text中的单词单词以“空格”、“Tab”或“回车”“换行”分隔是否符合模式pattern如果匹配的话则以replacement替换。这里pattern可以包括通配符“%” 表示任意长度的字串。 如果replacement中也包含“%” 那么 replacement中的这个“%”将是pattern中的那个“%”所代表的字串。可以用“\”来转义 以“%”来表示真实含义的“%”字符 返回 函数返回被替换过后的字符串。
1.3、去空格函数strip
函数原型$(strip string) 名称去空格函数——strip。 功能去掉string字串中开头和结尾的空字符。注意这里只去掉开头和结尾。 返回返回被去掉空格的字符串值。
1.4、查找字符串函数findstring
2、、:、区别
通过查询资料及试验个人感觉这3中赋值语法的区别主要是 赋值无论变量在makefile中被赋值多少次最后一次赋值将被应用于整个makefile.:赋值变量在makefile中的赋值立即生效如果变量被更改更改也立即生效。?赋值变量没有被定义时定义变量并赋值。如果变量已经存在则忽略赋值操作。
试验代码 a hello # not the last, skip
b $(a) world
a okay # not the last, skip
a OKAY # the last change is applied.c : hello # the immediate value is applied
d : $(c) world
c : okaye ? hello # the first change is applied
e ? HELLO # already exist, skip
f ? $(e) world
e ? worldall:echo $(b)echo : $(d)echo ? $(f)
输出