将文件名与其路径分开
我有来自此表达式的多个文件:
ui_files := $(wildcard $(SUBDIRS:%=%/*.ui)).
现在我需要相同文件路径的列表,但文件名中带有“ui_”前缀和另一个扩展名(.h)。我怎样才能做到这一点?
I have a number of files from this expression:
ui_files := $(wildcard $(SUBDIRS:%=%/*.ui)).
Now I need the list of the same file paths, but with "ui_" prefix in file name and another extension (.h). How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
foreach
迭代列表 并转换每个元素:或者,首先转换整个列表,然后使用
join
:两种解决方案都使用
dir
和notdir
函数。You can iterate over the list using
foreach
and transform each element:Or, first transform the whole list and then use
join
:Both solutions use
dir
andnotdir
functions.