开发者

how to write Android.mk files for multi-libs native c project?

I have a seGraphics lib ,it deps agg lib and freetype lib.All of them are source files I want to generate one seGraphics.a file. Should i write a Android.mk file for each? How to write it? TIA!

Here is my wrong try:

#Android.mk for seGraphics
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

include $(LOCAL_PATH)/../../Agg/Android.mk

LOCAL_CXXFLAGS := -I../../

LOCAL_MODULE := seGraphics

LOCAL_SRC_FILES := ../../seCommonGradientBrush.cpp ../../seHatchBrush.cpp  

LOCAL_CPP_EXTENSION := .cpp

include $(BUILD_STATIC_LIBRARY)

.

#Android.mk for agg
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := agg

LOCAL_LDFLAGS :=  
LOCAL_CFLAGS := -O3

LOCAL_C_INCLUDES := /home/maadiah/android-ndk-r6/platforms/android-9/arch-arm/usr/include \
        $(LOCAL_PATH)/font_freetype \
        $(LOCAL_PATH)/gpc \
            $(LOCAL_PATH)/include \
            $(LOCAL_PATH)/include/utils

AGG_SRCS := \
    $(LOCAL_PATH)/font_freetype/agg_font_freetype.cpp \
    $(LOCAL_PATH)/gpc/gpc.cpp \
    $(LOCAL_PATH)/src/*.cpp开发者_StackOverflow中文版 \

LOCAL_CPP_EXTENSION := .cpp     

include $(BUILD_STATIC_LIBRARY)


I have found it best to build each lib independently (i.e. freetype and agg). Then build seGraphics by linking against both freetype and agg using the following: LD_FLAGS += -lfreetype -lagg.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜