blob: 9e75e0d31575fba30eb6cfeceb98628bb8304b40 [file] [log] [blame]
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -05001LOCAL_PATH := $(call my-dir)
2
3# Build libtwrpmtp library
4
5include $(CLEAR_VARS)
6LOCAL_MODULE := libtwrpmtp-ffs
7LOCAL_MODULE_TAGS := optional
8LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -fno-strict-aliasing -Wno-unused-variable -Wno-format -Wno-unused-parameter -Wno-unused-private-field
9LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic frameworks/base/include system/core/include bionic/libc/private/ bootable/recovery/twrplibusbhost/include
10ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
11 LOCAL_C_INCLUDES += external/stlport/stlport
12 LOCAL_SHARED_LIBRARIES += libstlport
13else
14 LOCAL_SHARED_LIBRARIES += libc++
15endif
16
17LOCAL_SRC_FILES = \
18 MtpDataPacket.cpp \
19 MtpDebug.cpp \
20 MtpDevice.cpp \
21 MtpDevHandle.cpp \
22 MtpDeviceInfo.cpp \
23 MtpEventPacket.cpp \
24 MtpObjectInfo.cpp \
25 MtpPacket.cpp \
26 MtpProperty.cpp \
27 MtpRequestPacket.cpp \
28 MtpResponsePacket.cpp \
29 MtpServer.cpp \
30 MtpStorage.cpp \
31 MtpStorageInfo.cpp \
32 MtpStringBuffer.cpp \
33 MtpUtils.cpp \
34 mtp_MtpServer.cpp \
35 btree.cpp \
36 twrpMtp.cpp \
37 mtp_MtpDatabase.cpp \
38 node.cpp
39
40ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
41 LOCAL_CFLAGS += -D_FFS_DEVICE
42 LOCAL_SHARED_LIBRARIES += libasyncio
43 LOCAL_SRC_FILES += \
44 MtpDescriptors.cpp \
45 MtpFfsHandle.cpp \
46 MtpFfsCompatHandle.cpp \
47 PosixAsyncIO.cpp
48endif
49
50LOCAL_SHARED_LIBRARIES += libz \
51 libc \
52 libusbhost \
53 libstdc++ \
54 libdl \
55 libcutils \
56 libutils \
57 libaosprecovery \
58 libselinux \
59 libbase
60
61LOCAL_C_INCLUDES += bootable/recovery/twrplibusbhost/include
62
63ifneq ($(TW_MTP_DEVICE),)
64 LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE)
65endif
66ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
67 LOCAL_CFLAGS += -DHAS_USBHOST_TIMEOUT
68endif
69
70include $(BUILD_SHARED_LIBRARY)