title: Android NDK: how to include Android.mk into another Android.mk (hierarchical project structure)?
body: <p>Looks like it's possible, but my script produces odd results:</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  include $(CLEAR_VARS)
  
  include $(LOCAL_PATH)/libos/Android.mk
  include $(LOCAL_PATH)/libbase/Android.mk
  include $(LOCAL_PATH)/utils/Android.mk
  
  LOCAL_MODULE := native
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Only the first include is being parsed fine, other Android.mk files are being seacrhed at odd paths.
  Suggestions?</p>
  
  <p><strong>Update:</strong> I have broken my building environment... It was OK in the office, but at home LOCAL_PATH:= $(call my-dir) defines LOCAL_PATH to NDK dir instead of project dir. This is my batch for building: </p>
  
  <pre><code>set BASHPATH=K:\cygwin\bin\bash
  set PROJECTDIR=/cygdrive/h/Alex/Alex/Work/Android/remote-android
  set NDKDIR=/cygdrive/h/Alex/Programming_Docs/Android/android-ndk-r6/ndk-build
  set APP_BUILD_SCRIPT=/cygdrive/h/Alex/Alex/Work/Android/project/jni/Android.mk
  set DEV_ROOT=h:/Alex/Alex/Work/Android/project
  
  %BASHPATH% --login -c "cd %PROJECTDIR% &amp;&amp; %NDKDIR%"
  </code></pre>
  
  <p>Update: I absolutely don't understand how does this thing compose paths. I'm getting errors with paths like "/cygdrive/d/project/jni//cygdrive/d/Soft/project/jni/libos/src/libos.cpp'. This is after I decided to specify all files in the root Android.mk instead of including submodules.</p>
  
  <p><strong>Update 2:</strong>  No luck, this doesn't work either:</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  # Include makefiles here.
  include $(LOCAL_PATH)/libos/Android.mk
  include $(LOCAL_PATH)/libbase/Android.mk
  include $(LOCAL_PATH)/utils/Android.mk
  
  # Clear variables here.
   include $(CLEAR_VARS)
  </code></pre>