bigbiff bigbiff | af32bb9 | 2018-12-18 18:39:53 -0500 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | # Build libtwrpmtp library |
| 4 | |
| 5 | include $(CLEAR_VARS) |
| 6 | LOCAL_MODULE := libtwrpmtp-ffs |
| 7 | LOCAL_MODULE_TAGS := optional |
| 8 | LOCAL_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 |
| 9 | LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic frameworks/base/include system/core/include bionic/libc/private/ bootable/recovery/twrplibusbhost/include |
| 10 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) |
| 11 | LOCAL_C_INCLUDES += external/stlport/stlport |
| 12 | LOCAL_SHARED_LIBRARIES += libstlport |
| 13 | else |
| 14 | LOCAL_SHARED_LIBRARIES += libc++ |
| 15 | endif |
| 16 | |
| 17 | LOCAL_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 | |
| 40 | ifeq ($(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 |
| 48 | endif |
| 49 | |
| 50 | LOCAL_SHARED_LIBRARIES += libz \ |
| 51 | libc \ |
| 52 | libusbhost \ |
| 53 | libstdc++ \ |
| 54 | libdl \ |
| 55 | libcutils \ |
| 56 | libutils \ |
| 57 | libaosprecovery \ |
| 58 | libselinux \ |
| 59 | libbase |
| 60 | |
| 61 | LOCAL_C_INCLUDES += bootable/recovery/twrplibusbhost/include |
| 62 | |
| 63 | ifneq ($(TW_MTP_DEVICE),) |
| 64 | LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE) |
| 65 | endif |
| 66 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0) |
| 67 | LOCAL_CFLAGS += -DHAS_USBHOST_TIMEOUT |
| 68 | endif |
| 69 | |
| 70 | include $(BUILD_SHARED_LIBRARY) |