makefile:递归查找并删除辅助文件(makefile : find recursively and delete auxiliary files)

系统教程 行业动态 更新时间:2024-06-14 16:54:47
makefile:递归查找并删除辅助文件(makefile : find recursively and delete auxiliary files)

假设我有一个已知的文件列表:

EXT=*ext1 *ext2 *ext3

我想在我的makefile中使用类似的东西

clean:$(EXT) find . -name @< -delete

但我不能使它工作,因为我需要使用每个扩展名的查找命令EXT不仅在第一个或同时所有的...

显然,目标是能够快速添加和删除列表中的扩展名。

Assume I have a list of file known by their extention:

EXT=*ext1 *ext2 *ext3

I want to use in my makefile something like

clean:$(EXT) find . -name @< -delete

But I can't make it work because I need to use the find command for each extension is EXT not only on the first one or for all of the at the same time...

The goal is obviously to be able to quickly add and remove extension from the list.

最满意答案

使用for循环:

clean: for i in $(EXT); do find . -name "$$i" -delete; done

Use a for loop:

clean: for i in $(EXT); do find . -name "$$i" -delete; done

更多推荐

本文发布于:2023-04-08 12:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/d048911d6eee4462857589e58c5b3afa.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:递归   文件   find   makefile   auxiliary

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!