一、源码编译
1.1 so预编译LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libAppArea
LOCAL_SRC_FILES :=libAppArea.so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX:=$(HOST_JNILIB_SUFFIX)
LOCAL_CERTIFICATE:=platform
LOCAL_PRELINK_MODULE := false
include $(BUILD_PREBUILT)
1.2 share lib编译
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
#LDFLAGS+=-ldl
LOCAL_LDLIBS := -ldl -lm -llog -llibc
LOCAL_MODULE := libnandFlashReadPage_jni
LOCAL_SRC_FILES := nandFlashReadPage_jni.cpp
LOCAL_SHARED_LIBRARIES := libdllibloglibpre_NandRecognitionlibpre_AppArealibclibstdc++
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
原文:http://blog.csdn.net/longtian635241/article/details/37918981