makefile中使用shell命令并将结果保存为变量

KSRC = $(shell pwd | sed 's/wifi.*/linux/g')


解释一下:pwd 获取当前目录 通过管道输入到sed中, 在sed中作替换处理,将wifi后面的所有内容包括wifi替换为linux. 最后将结果保存在KSRC中



猜你喜欢

转载自blog.csdn.net/ti_tantbx/article/details/7398825
今日推荐