title: How to escape backslash in makefile shell function
body: <p>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. </p>
  
  <p>In bash the following does what I want:</p>
  
  <pre><code>find path1 path2 path3 -type f \( -name *.hpp -o -name *.h -o *.hxx \)
  </code></pre>
  
  <p>In my make file I have tried a few combinations of foreach, etc. Currently I have this:</p>
  
  <pre><code>INCLUDE_PATHS ?= path1 path2 path3
  MY_HEADERS := $(shell find $(INCLUDE_PATHS) -type f \( -name *.h -o -name *.hpp -o -name *.hxx \))
  </code></pre>
  
  <p>This produces:</p>
  
  <pre><code>find: paths must precede expression
  Usage: find [-H] [-L] [-P] [path...] [expression]
  </code></pre>
  
  <p>If I just look for one extension such as "*.hpp" it works fine (I assume because the \(...\) is not needed).</p>
  
  <p>I have tried various combinations of $, ', ". \ to escape the '\' characters in the shell command without success.</p>
  
  <p>Any help would be greatly appreciated.</p>