jni 静态库的编译

只需要在Android.mk里写上“include $(BUILD_STATIC_LIBRARY)”,就会编译出静态库。

 

没有找到Android.mk的文档,参数可以参考$(ANDROID_DIR)/build/core/config.mk。


贴一个Android.mk实例

LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE:= libhanwang LOCAL_SRC_FILES:= / ftr.S / hw.S / norm.S / recog.S / sort.S LOCAL_SHARED_LIBRARIES := LOCAL_STATIC_LIBRARIES := LOCAL_C_INCLUDES += / hw.h / linkage.h LOCAL_CFLAGS += -mlittle-endian -D__ASSEMBLY__ LOCAL_PRELINK_MODULE := false include $(BUILD_STATIC_LIBRARY)

 

如果编译出现OVERRIDE_BUILT_MODULE_PATH的错误, 需要在工程顶层目录下添加Android.mk文件,文件内容为:

include $(call all-subdir-makefiles)

你可能感兴趣的:(jni 静态库的编译)