15 March 2015

Best Guide:

Add your applications into products

  1. Need add it to PRODUCT_PACKAGES, otherwise it won't be built to final product.
  2. Need define the application's Android.mk under TOP, so it can be scaned by build system.

If you don't want your application to be built into final product, then just remove it from PRODUCT_PACKAGES.

Add Prebuilts

here is a good reference http://blog.csdn.net/jscese/article/details/40615801.

  1. Use PRODUCT_COPY_FILES, "+= src:dst". Copy file only, can't execute any script. So the source file can't get any dependencies.
  2. Use BUILD_PREBUILT
  3. Use BUILD_MULTI_PREBUILT, only support known types.
  4. use add-prebuilt-files. do as bellow: "$(call add-prebuilt-files, class, filename)"

here, the class can be any of: ETC, APPS, EXECUTABLES, SHARED_LIBRARIES, STATIC_LIBRARIES

BUILD_MULTI_PREBUILT

When use BUILD_MULTI_PREBUILT, multiple LOCAL_MODULE will be created, and each module name is the basename of each LOCAL_SRC_FILES.

See build/core/multi_prebuilt.mk

Say

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := out/libA.so out/libB.so
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
include $(BUILD_MULTI_PREBUILT)

Others



blog comments powered by Disqus