blob: 740afcb1192c54b08acd82b216d96954a0a55c68 [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 \
16 bootable/recovery/install/include
17
18LOCAL_SHARED_LIBRARIES += libc++ libaosprecovery
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -050019
20LOCAL_SRC_FILES = \
21 MtpDataPacket.cpp \
22 MtpDebug.cpp \
23 MtpDevice.cpp \
24 MtpDevHandle.cpp \
25 MtpDeviceInfo.cpp \
26 MtpEventPacket.cpp \
27 MtpObjectInfo.cpp \
28 MtpPacket.cpp \
29 MtpProperty.cpp \
30 MtpRequestPacket.cpp \
31 MtpResponsePacket.cpp \
32 MtpServer.cpp \
33 MtpStorage.cpp \
34 MtpStorageInfo.cpp \
35 MtpStringBuffer.cpp \
36 MtpUtils.cpp \
37 mtp_MtpServer.cpp \
38 btree.cpp \
39 twrpMtp.cpp \
40 mtp_MtpDatabase.cpp \
41 node.cpp
42
43ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
44 LOCAL_CFLAGS += -D_FFS_DEVICE
45 LOCAL_SHARED_LIBRARIES += libasyncio
46 LOCAL_SRC_FILES += \
47 MtpDescriptors.cpp \
48 MtpFfsHandle.cpp \
49 MtpFfsCompatHandle.cpp \
50 PosixAsyncIO.cpp
51endif
52
53LOCAL_SHARED_LIBRARIES += libz \
54 libc \
55 libusbhost \
56 libstdc++ \
57 libdl \
58 libcutils \
59 libutils \
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -050060 libselinux \
61 libbase
62
63LOCAL_C_INCLUDES += bootable/recovery/twrplibusbhost/include
64
65ifneq ($(TW_MTP_DEVICE),)
66 LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE)
67endif
68ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
69 LOCAL_CFLAGS += -DHAS_USBHOST_TIMEOUT
70endif
71
72include $(BUILD_SHARED_LIBRARY)