1# Copyright 2005 The Android Open Source Project 2# 3# Android.mk for adb 4# 5 6LOCAL_PATH:= $(call my-dir) 7 8# adb host tool 9# ========================================================= 10include $(CLEAR_VARS) 11 12# Default to a virtual (sockets) usb interface 13USB_SRCS := 14EXTRA_SRCS := 15 16ifeq ($(HOST_OS),linux) 17 USB_SRCS := usb_linux.c 18 EXTRA_SRCS := get_my_path_linux.c 19 LOCAL_LDLIBS += -lrt -ldl -lpthread 20 LOCAL_CFLAGS += -DWORKAROUND_BUG6558362 21endif 22 23ifeq ($(HOST_OS),darwin) 24 USB_SRCS := usb_osx.c 25 EXTRA_SRCS := get_my_path_darwin.c 26 LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon 27endif 28 29ifeq ($(HOST_OS),freebsd) 30 USB_SRCS := usb_libusb.c 31 EXTRA_SRCS := get_my_path_freebsd.c 32 LOCAL_LDLIBS += -lpthread -lusb 33endif 34 35ifeq ($(HOST_OS),windows) 36 USB_SRCS := usb_windows.c 37 EXTRA_SRCS := get_my_path_windows.c 38 EXTRA_STATIC_LIBS := AdbWinApi 39 ifneq ($(strip $(USE_CYGWIN)),) 40 # Pure cygwin case 41 LOCAL_LDLIBS += -lpthread -lgdi32 42 endif 43 ifneq ($(strip $(USE_MINGW)),) 44 # MinGW under Linux case 45 LOCAL_LDLIBS += -lws2_32 -lgdi32 46 USE_SYSDEPS_WIN32 := 1 47 endif 48 LOCAL_C_INCLUDES += development/host/windows/usb/api/ 49endif 50 51LOCAL_SRC_FILES := \ 52 adb.c \ 53 console.c \ 54 transport.c \ 55 transport_local.c \ 56 transport_usb.c \ 57 commandline.c \ 58 adb_client.c \ 59 adb_auth_host.c \ 60 sockets.c \ 61 services.c \ 62 file_sync_client.c \ 63 $(EXTRA_SRCS) \ 64 $(USB_SRCS) \ 65 usb_vendors.c 66 67LOCAL_C_INCLUDES += external/openssl/include 68 69ifneq ($(USE_SYSDEPS_WIN32),) 70 LOCAL_SRC_FILES += sysdeps_win32.c 71else 72 LOCAL_SRC_FILES += fdevent.c 73endif 74 75LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror 76LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE 77LOCAL_MODULE := adb 78LOCAL_MODULE_TAGS := debug 79 80LOCAL_STATIC_LIBRARIES := libzipfile libunz libcrypto_static $(EXTRA_STATIC_LIBS) 81ifeq ($(USE_SYSDEPS_WIN32),) 82 LOCAL_STATIC_LIBRARIES += libcutils 83endif 84 85include $(BUILD_HOST_EXECUTABLE) 86 87$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) 88 89ifeq ($(HOST_OS),windows) 90$(LOCAL_INSTALLED_MODULE): \ 91 $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ 92 $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll 93endif 94 95 96# adbd device daemon 97# ========================================================= 98 99include $(CLEAR_VARS) 100 101LOCAL_SRC_FILES := \ 102 adb.c \ 103 fdevent.c \ 104 transport.c \ 105 transport_local.c \ 106 transport_usb.c \ 107 adb_auth_client.c \ 108 sockets.c \ 109 services.c \ 110 file_sync_service.c \ 111 jdwp_service.c \ 112 framebuffer_service.c \ 113 remount_service.c \ 114 disable_verity_service.c \ 115 usb_linux_client.c 116 117LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter -Werror 118LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE 119 120ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 121LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 122endif 123 124ifneq (,$(filter userdebug,$(TARGET_BUILD_VARIANT))) 125LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 126endif 127 128LOCAL_MODULE := adbd 129 130LOCAL_FORCE_STATIC_EXECUTABLE := true 131LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 132LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 133LOCAL_C_INCLUDES += system/extras/ext4_utils system/core/fs_mgr/include 134 135LOCAL_STATIC_LIBRARIES := liblog \ 136 libfs_mgr \ 137 libcutils \ 138 libc \ 139 libmincrypt \ 140 libselinux \ 141 libext4_utils_static 142 143include $(BUILD_EXECUTABLE) 144 145 146# adb host tool for device-as-host 147# ========================================================= 148ifneq ($(SDK_ONLY),true) 149include $(CLEAR_VARS) 150 151LOCAL_SRC_FILES := \ 152 adb.c \ 153 console.c \ 154 transport.c \ 155 transport_local.c \ 156 transport_usb.c \ 157 commandline.c \ 158 adb_client.c \ 159 adb_auth_host.c \ 160 sockets.c \ 161 services.c \ 162 file_sync_client.c \ 163 get_my_path_linux.c \ 164 usb_linux.c \ 165 usb_vendors.c \ 166 fdevent.c 167 168LOCAL_CFLAGS := \ 169 -O2 \ 170 -g \ 171 -DADB_HOST=1 \ 172 -DADB_HOST_ON_TARGET=1 \ 173 -Wall -Wno-unused-parameter -Werror \ 174 -D_XOPEN_SOURCE \ 175 -D_GNU_SOURCE 176 177LOCAL_C_INCLUDES += external/openssl/include 178 179LOCAL_MODULE := adb 180 181LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils liblog 182 183LOCAL_SHARED_LIBRARIES := libcrypto 184 185include $(BUILD_EXECUTABLE) 186endif 187