How to filter out files with multiple criteria in a Makefile?

天涯浪子 提交于 2019-12-23 12:14:46

问题


Lets say you filter for cpp files like so

$(wildcard **/*.cpp)

But you don't want files that contain the word foo and you don't want the file with the exact name bar.cpp

How does one use filter-out with multiple criteria?


回答1:


This seems to work. Also recursively.

$(filter-out $(wildcard **/bar.cpp) $(wildcard **/*foo*), $(wildcard **/*.cpp))

Please also note Etan's simpler suggestion below. Leaving mine only for completeness.



来源:https://stackoverflow.com/questions/36719876/how-to-filter-out-files-with-multiple-criteria-in-a-makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!