8

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?

Johnny Haddock
  • 415
  • 3
  • 11
  • 1
    Wanted to point out that if you think using the `**` construct will cause make's `wildcard` function to search directories recursively like zsh does... it won't. – MadScientist Apr 21 '16 at 12:41

1 Answers1

8

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.

Johnny Haddock
  • 415
  • 3
  • 11