title: How can I add a directory to the search path of GNU Make?
body: <p>I have a makefile that looks something like this:</p>
  
  <pre><code>include anotherFile.mk
  
  all:
      someStuff
  </code></pre>
  
  <p>The file <code>anotherFile.mk</code> is like this:</p>
  
  <pre><code>include yetAnotherFile.mk
  export SOME_VAR = 93
  </code></pre>
  
  <p>The problem is that <code>anotherFile.mk</code> and <code>yetAnotherFile.mk</code> are in a different directory from my Makefile.  So my makefile can't just be changed to this:</p>
  
  <pre><code>include $(OTHER_PROJECT_PATH)/anotherFile.mk
  
  all:
      someStuff
  </code></pre>
  
  <p>The problem with this approach is that the include statement in <code>anotherFile.mk</code> will fail because it will be searching in the current directory.</p>
  
  <p>A partial solution that I found is to pass the <code>--include-dir=$OTHER_PROJECT_PATH</code> flag to the invocation of make, but that's a bit user-unfriendly.</p>
  
  <p>So my question is: Is there something I can put inside my makefile that will add to the directories that make searches for when executing an <code>include</code>?  Something like <code>MAKE_INCLUDE_DIRS += $(OTHER_PROJECT_PATH)</code></p>