title: How to use ndk-build without jni directory?
body: <p>We are attempting to add first class build support for Android to a C++ library. We want to supply a stock <code>Android.mk</code>, and disgorge it from dependencies like a <code>jni</code> subfolder in an Eclipse or Android Studio project directory. That is, we want to:</p>
  
  <pre><code>cd library-src
  ndk-build &lt;options&gt;
  </code></pre>
  
  <p>In the above, <code>library-src</code> <em>is not</em> <code>NDK_PROJECT_PATH</code>. Rather, its the root folder for the library.</p>
  
  <p>We visited the NDK's help (<code>ndk-build -?</code>), but it did not tell us how to remove the assumptions. We tried the following, but it produced an errors:</p>
  
  <pre><code>$ ndk-build -f Android.mk
  Android NDK: Could not find application project directory !    
  Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
  /opt/android-ndk-r10e/build/core/build-local.mk:143: *** Android NDK: Aborting
  Stop.
  </code></pre>
  
  <p>Attempting to set <code>NDK_PROJECT_PATH</code> results in a similar error:</p>
  
  <pre><code>$ NDK_PROJECT_PATH=. ndk-build -f Android.mk
  Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk    
  /opt/android-ndk-r10e/.../add-application.mk:199: *** Android NDK: Aborting...
  Stop.
  </code></pre>
  
  <p>And attempting to set <code>APP_BUILD_SCRIPT</code> results in a similar error:</p>
  
  <pre><code>$ NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk ndk-build -f Android.mk
  Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk    
  /opt/android-ndk-r10e/.../add-application.mk:199: *** Android NDK: Aborting...
  Stop.
  </code></pre>
  
  <p>How do we use ndk-build without the jni directory?</p>
  
  <hr>
  
  <p>Its important that we remove the limitations/assumptions. If we can't remove them, then we can't automate building and testing. If we can't automate building and testing, then we can't add the support because our governance has some QA and testing gates that we won't be able to pass through. (I'm willing to tolerate a manual <code>adb push</code> to test on-device).</p>