blob: 90f9d3259339245eb6a07c15dbf0f9cd3ba9990b [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
bigbiffd58ba182020-03-23 10:02:29 -04008LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -fno-strict-aliasing \
9 -Wno-unused-variable -Wno-format -Wno-unused-parameter -Wno-unused-private-field \
10 -Wno-implicit-fallthrough
11LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic \
12 frameworks/base/include \
13 system/core/include \
14 bionic/libc/private/ \
15 bootable/recovery/twrplibusbhost/include \
bigbiff1f9e4842020-10-31 11:33:15 -040016 bootable/recovery/twrpinstall/include
bigbiffd58ba182020-03-23 10:02:29 -040017
bigbiff1f9e4842020-10-31 11:33:15 -040018LOCAL_SHARED_LIBRARIES += libc++
19LOCAL_STATIC_LIBRARIES += libtwrpinstall
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -050020
21LOCAL_SRC_FILES = \
22 MtpDataPacket.cpp \
23 MtpDebug.cpp \
24 MtpDevice.cpp \
25 MtpDevHandle.cpp \
26 MtpDeviceInfo.cpp \
27 MtpEventPacket.cpp \
28 MtpObjectInfo.cpp \
29 MtpPacket.cpp \
30 MtpProperty.cpp \
31 MtpRequestPacket.cpp \
32 MtpResponsePacket.cpp \
33 MtpServer.cpp \
34 MtpStorage.cpp \
35 MtpStorageInfo.cpp \
36 MtpStringBuffer.cpp \
37 MtpUtils.cpp \
38 mtp_MtpServer.cpp \
39 btree.cpp \
40 twrpMtp.cpp \
41 mtp_MtpDatabase.cpp \
42 node.cpp
43
44ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
45 LOCAL_CFLAGS += -D_FFS_DEVICE
46 LOCAL_SHARED_LIBRARIES += libasyncio
47 LOCAL_SRC_FILES += \
48 MtpDescriptors.cpp \
49 MtpFfsHandle.cpp \
50 MtpFfsCompatHandle.cpp \
51 PosixAsyncIO.cpp
52endif
53
54LOCAL_SHARED_LIBRARIES += libz \
55 libc \
56 libusbhost \
57 libstdc++ \
58 libdl \
59 libcutils \
60 libutils \
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -050061 libselinux \
James Wei471fff52019-05-28 17:18:21 +080062 libbase \
63 liblog
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -050064
65LOCAL_C_INCLUDES += bootable/recovery/twrplibusbhost/include
66
67ifneq ($(TW_MTP_DEVICE),)
68 LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE)
69endif
70ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
71 LOCAL_CFLAGS += -DHAS_USBHOST_TIMEOUT
72endif
73
74include $(BUILD_SHARED_LIBRARY)