我的结构是
packages/apps/myapp //No Java source file
|
Android.mk / first Makefile,
jni __
|
source.c
Android.mk // 2nd Makefile
libs // Prebuilt libs
首先是Amdroid.mk
LOCAL_PATH := $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH))
第二个Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libabc
LOCAL_SRC_FILES := $(LOCAL_PATH)/libabc.so
LOCAL_MODULE_TAGS := optional
LOCAL_PRELINK_MODULE := false
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
my_jni.c
LOCAL_SHARED_LIBRARIES := \
libabc \
LOCAL_C_INCLUDES := \
includes
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libmy_jni
include $(BUILD_SHARED_LIBRARY)
但这总是给我错误:
make: *** No rule to make target `out/target/product/myproduct/obj/lib/libabc.so', needed by `out/target/product/myproduct/obj/SHARED_LIBRARIES/libmy_jni_intermediates/LINKED/libmy_jni.so'
任何帮助都将不胜感激。