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 usb_linux_client.c 115 116LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter -Werror 117LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE 118 119ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 120LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 121endif 122 123LOCAL_MODULE := adbd 124 125LOCAL_FORCE_STATIC_EXECUTABLE := true 126LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 127LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 128 129LOCAL_STATIC_LIBRARIES := liblog libcutils libc libmincrypt libselinux 130include $(BUILD_EXECUTABLE) 131 132 133# adb host tool for device-as-host 134# ========================================================= 135ifneq ($(SDK_ONLY),true) 136include $(CLEAR_VARS) 137 138LOCAL_SRC_FILES := \ 139 adb.c \ 140 console.c \ 141 transport.c \ 142 transport_local.c \ 143 transport_usb.c \ 144 commandline.c \ 145 adb_client.c \ 146 adb_auth_host.c \ 147 sockets.c \ 148 services.c \ 149 file_sync_client.c \ 150 get_my_path_linux.c \ 151 usb_linux.c \ 152 usb_vendors.c \ 153 fdevent.c 154 155LOCAL_CFLAGS := \ 156 -O2 \ 157 -g \ 158 -DADB_HOST=1 \ 159 -DADB_HOST_ON_TARGET=1 \ 160 -Wall -Wno-unused-parameter -Werror \ 161 -D_XOPEN_SOURCE \ 162 -D_GNU_SOURCE 163 164LOCAL_C_INCLUDES += external/openssl/include 165 166LOCAL_MODULE := adb 167 168LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils liblog 169 170LOCAL_SHARED_LIBRARIES := libcrypto 171 172include $(BUILD_EXECUTABLE) 173endif 174