zeerd's blog     Article     Search     About     Tags     Pebble     Feed

闲来生雅趣,无事乐逍遥。对窗相望雪,一盏茶香飘。

taglib移植到Android下使用的Android.mk文件

#Android #Makefile #Porting #TagLib


Android没有预置cppunit,所以tests目录下的内容没有编译。

#

define my-all-cpp-files-under
$(patsubst ./%,%, \\
$(shell cd $(LOCAL_PATH) ; \\
find -L $(1) -name "*.cpp" -and -not -name ".*") \\
)
endef

define my-all-c-files-under
$(patsubst ./%,%, \\
$(shell cd $(LOCAL_PATH) ; \\
find -L $(1) -name "*.c" -and -not -name ".*") \\
)
endef

define my-all-dir-under
$(patsubst ./%,%, \\
$(shell find -L $(LOCAL_PATH)/$(1) -name "*" -and -not -name "*.*" -type d) \\
)
endef

# ============================================================
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private

LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := $(call my-all-cpp-files-under, \\
taglib)

#$(call print-vars, LOCAL_PATH)
#$(call print-vars, LOCAL_C_INCLUDES)
$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := libtag
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libstlport

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a


include $(BUILD_SHARED_LIBRARY)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private

LOCAL_C_INCLUDES += bindings/c/
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := bindings/c/tag_c.cpp

LOCAL_MODULE := libtag_c
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libstlport libtag

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_SHARED_LIBRARY)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
examples)
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := \\
examples/tagreader.cpp

$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := taglib-examples-tagreader
LOCAL_SHARED_LIBRARIES := libtag libstlport

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_EXECUTABLE)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
examples)
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := \\
examples/tagwriter.cpp

$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := taglib-examples-tagwriter
LOCAL_SHARED_LIBRARIES := libtag libstlport

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_EXECUTABLE)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
examples)
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := \\
examples/tagreader_c.c

$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := taglib-examples-tagreader_c
LOCAL_SHARED_LIBRARIES := libtag libstlport libtag_c

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_EXECUTABLE)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
examples)
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := \\
examples/strip-id3v1.cpp

$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := taglib-examples-strip-id3v1
LOCAL_SHARED_LIBRARIES := libtag libstlport

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_EXECUTABLE)

# ============================================================
include $(CLEAR_VARS)

LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
external/stlport/stlport \\
bionic \\
bionic/libc/private
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
examples)
LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
taglib)

LOCAL_SRC_FILES := \\
examples/framelist.cpp

$(call print-vars, LOCAL_SRC_FILES)

LOCAL_MODULE := taglib-examples-framelist
LOCAL_SHARED_LIBRARIES := libtag libstlport

LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

include $(BUILD_EXECUTABLE)

## ============================================================
#include $(CLEAR_VARS)

#LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \\
#external/stlport/stlport \\
#bionic \\
#bionic/libc/private
#LOCAL_C_INCLUDES += $(call my-all-dir-under, \\
#tests)

#LOCAL_SRC_FILES := $(call my-all-cpp-files-under, \\
#tests)

#LOCAL_MODULE := test_taglib
#LOCAL_PRELINK_MODULE := false
#LOCAL_MODULE_TAGS := optional
#LOCAL_SHARED_LIBRARIES := taglib libstlport

#LOCAL_CFLAGS := -Wno-error=non-virtual-dtor -frtti
#LOCAL_LDFLAGS := prebuilts/ndk/6/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a

#include $(BUILD_EXECUTABLE)