对于Android系统集成有源码的第三方库和程序,只需要提供Android.mk文件,把源码集成到Android编译系统中就可以了,并且有很多例子可以参考。但是对于没有源码的pre-build第三方库和程序,网上介绍的比较少,可以参考的例子也不多。本文简单介绍一下集成pre-build库和程序时候,怎样编写Android.mk。
1、集成静态库
1: LOCAL_PATH := $(call my-dir)
2: include $(CLEAR_VARS)
3:
4: LOCAL_PREBUILT_LIBS := libA.a \
5: libB.a
6:
7: LOCAL_STATIC_LIBRARIES := libA \
8: libB
9:
10: include $(BUILD_MULTI_PREBUILT)
2、集成动态库
1: LOCAL_PATH := $(call my-dir)
2: include $(CLEAR_VARS)
3:
4: LOCAL_PREBUILT_LIBS := libA.so
5: libB.so
6: include $(BUILD_MULTI_PREBUILT)
3、集成可执行程序
1: LOCAL_PATH := $(call my-dir)
2: include $(CLEAR_VARS)
3:
4: LOCAL_SRC_FILES := hellovprc.elf
5: LOCAL_MODULE := hellovprc.elf
6: LOCAL_MODULE_CLASS := EXECUTABLES
7: LOCAL_MODULE_TAGS := debug
8: include $(BUILD_PREBUILT)