I need to recursively find all the header files in a list of directories. I can't figure out how to escape the command properly. I have searched around and found various information on escaping in makefiles but I have not been able to solve this issue.
In bash the following does what I want:
find path1 path2 path3 -type f \( -name *.hpp -o -name *.h -o *.hxx \)
In my make file I have tried a few combinations of foreach, etc. Currently I have this:
INCLUDE_PATHS ?= path1 path2 path3
MY_HEADERS := $(shell find $(INCLUDE_PATHS) -type f \( -name *.h -o -name *.hpp -o -name *.hxx \))
This produces:
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
If I just look for one extension such as "*.hpp" it works fine (I assume because the \(...\) is not needed).
I have tried various combinations of $, ', ". \ to escape the '\' characters in the shell command without success.
Any help would be greatly appreciated.