title: Android NDK: build fat binary with BUILD_EXECUTABLE and armeabi-v7a-hard
body: <p><strong>Short:</strong> How does Android NDK system transform "APP_ABI := armeabi-v7a-hard" to final .so files located in "libs/armeabi-v7a"? What is the proper way to do same thing in Android.mk? Currently, to build standalone executable and place it in folders corresponding to different ABIs I use this, which is it looks ugly because of hard coded "ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)":</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  include $(CLEAR_VARS)
  SAVED_NDK_APP_DST_DIR := $(NDK_APP_DST_DIR)
  
  ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
      NDK_APP_DST_DIR := assets/armeabi-v7a
  else
      NDK_APP_DST_DIR := assets/$(TARGET_ARCH_ABI)
  endif
  
  LOCAL_MODULE := run_pie
  LOCAL_SRC_FILES := run_pie.c    
  include $(BUILD_EXECUTABLE)
  NDK_APP_DST_DIR := $(SAVED_NDK_APP_DST_DIR)
  </code></pre>
  
  <p><strong>Long:</strong> In my Android app I'm using set of standalone binaries. After build they stored in APK resources. On first app launch I copy them to my app private folder, chmod 777, and than use them as system utilities, like "ls" or "cp". I want to produce "fat binary": single APK that has binaries for all ABIs and choose right binary for current device after installation. For .so libraries Android doing all this stuff automatically. And "APP_ABI := armeabi-v7a-hard" is internal to NDK build system, it's stated in docs, and final .so files for "armeabi-v7a-hard" is placed in "armeabi-v7a" folder. I can do same for my binaries and currently I have way that is working, however it looks ugly.</p>
  
  <p><strong>What is the proper way to place output binaries to custom folders named with ABIs and handle "armeabi-v7a-hard" to "armeabi-v7a" conversion?</strong></p>