Android 系统下要编写Android.mk来生成相应的库文件已经非常模板化了。
//@Android.mk //静态库的编写
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES:= /
aa.c bb.c dd.c /
LOCAL_SHARED_LIBRARIES := /
dd ee ff /
LOCAL_C_INCLUDES += /
$(LOCAL_PATH)/../inc
LOCAL_CFLAGS += -MD /
-FF -Uarm -DMODULE -D__LINUX_ARM_ARCH__=7 /
LOCAL_MODULE:= libMyStaticLib
include $(BUILD_STATIC_LIBRARY)
//静态库生成后的文件是libMyStaticLib.a
//@Android.mk //动态库的编写
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES:= /
aa.c bb.c dd.c /
LOCAL_SHARED_LIBRARIES := /
dd ee ff /
LOCAL_C_INCLUDES += /
$(LOCAL_PATH)/../inc
LOCAL_CFLAGS += -MD /
-FF -Uarm -DMODULE -D__LINUX_ARM_ARCH__=7 /
LOCAL_MODULE:= libMyShareLib
include $(BUILD_SHARED_LIBRARY)
//动态库生成后的文件是libMyShareLib.so