| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # Copyright 2005 The Android Open Source Project | 
 | 2 | # | 
 | 3 | # Android.mk for adb | 
 | 4 | # | 
 | 5 |  | 
 | 6 | LOCAL_PATH:= $(call my-dir) | 
 | 7 |  | 
 | 8 | # adb host tool | 
 | 9 | # ========================================================= | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 10 | include $(CLEAR_VARS) | 
 | 11 |  | 
 | 12 | # Default to a virtual (sockets) usb interface | 
 | 13 | USB_SRCS := | 
 | 14 | EXTRA_SRCS := | 
 | 15 |  | 
 | 16 | ifeq ($(HOST_OS),linux) | 
 | 17 |   USB_SRCS := usb_linux.c | 
 | 18 |   EXTRA_SRCS := get_my_path_linux.c | 
| Chih-Wei Huang | ed1107d | 2013-01-01 15:24:33 +0800 | [diff] [blame] | 19 |   LOCAL_LDLIBS += -lrt -ldl -lpthread | 
| Benoit Goby | 12dc369 | 2013-02-20 15:04:53 -0800 | [diff] [blame] | 20 |   LOCAL_CFLAGS += -DWORKAROUND_BUG6558362 | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 21 | endif | 
 | 22 |  | 
 | 23 | ifeq ($(HOST_OS),darwin) | 
 | 24 |   USB_SRCS := usb_osx.c | 
 | 25 |   EXTRA_SRCS := get_my_path_darwin.c | 
| Benoit Goby | ed7bc3f | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 26 |   LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon | 
| Tim Murray | ce2f106 | 2014-07-24 18:33:12 -0700 | [diff] [blame] | 27 |   LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 28 | endif | 
 | 29 |  | 
| Alexey Tarasov | 12a1d04 | 2009-10-25 01:37:37 +1100 | [diff] [blame] | 30 | ifeq ($(HOST_OS),freebsd) | 
 | 31 |   USB_SRCS := usb_libusb.c | 
 | 32 |   EXTRA_SRCS := get_my_path_freebsd.c | 
 | 33 |   LOCAL_LDLIBS += -lpthread -lusb | 
 | 34 | endif | 
 | 35 |  | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 36 | ifeq ($(HOST_OS),windows) | 
 | 37 |   USB_SRCS := usb_windows.c | 
| Mark Salyzyn | bec305f | 2013-12-06 15:50:48 -0800 | [diff] [blame] | 38 |   EXTRA_SRCS := get_my_path_windows.c | 
| Benoit Goby | ed7bc3f | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 39 |   EXTRA_STATIC_LIBS := AdbWinApi | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 |   ifneq ($(strip $(USE_CYGWIN)),) | 
| Raphael | 173b0c6 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 41 |     # Pure cygwin case | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 42 |     LOCAL_LDLIBS += -lpthread -lgdi32 | 
| Raphael | 173b0c6 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 43 |     LOCAL_C_INCLUDES += /usr/include/w32api/ddk | 
 | 44 |   endif | 
 | 45 |   ifneq ($(strip $(USE_MINGW)),) | 
 | 46 |     # MinGW under Linux case | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 47 |     LOCAL_LDLIBS += -lws2_32 -lgdi32 | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 48 |     USE_SYSDEPS_WIN32 := 1 | 
| Raphael | 173b0c6 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 49 |     LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 50 |   endif | 
| Raphael | 173b0c6 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 51 |   LOCAL_C_INCLUDES += development/host/windows/usb/api/ | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 52 | endif | 
 | 53 |  | 
 | 54 | LOCAL_SRC_FILES := \ | 
 | 55 | 	adb.c \ | 
 | 56 | 	console.c \ | 
 | 57 | 	transport.c \ | 
 | 58 | 	transport_local.c \ | 
 | 59 | 	transport_usb.c \ | 
 | 60 | 	commandline.c \ | 
 | 61 | 	adb_client.c \ | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 62 | 	adb_auth_host.c \ | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 63 | 	sockets.c \ | 
 | 64 | 	services.c \ | 
 | 65 | 	file_sync_client.c \ | 
 | 66 | 	$(EXTRA_SRCS) \ | 
 | 67 | 	$(USB_SRCS) \ | 
| Raphael | 121c4ec | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 68 | 	usb_vendors.c | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 69 |  | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 70 | LOCAL_C_INCLUDES += external/openssl/include | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 |  | 
 | 72 | ifneq ($(USE_SYSDEPS_WIN32),) | 
 | 73 |   LOCAL_SRC_FILES += sysdeps_win32.c | 
| David 'Digit' Turner | b1c2c95 | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 74 | else | 
 | 75 |   LOCAL_SRC_FILES += fdevent.c | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 76 | endif | 
 | 77 |  | 
| Mark Salyzyn | 63e39f2 | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 78 | LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror | 
| Jack Palevich | 5563d52 | 2010-05-25 14:49:57 +0800 | [diff] [blame] | 79 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 80 | LOCAL_MODULE := adb | 
| Benoit Goby | 12dc369 | 2013-02-20 15:04:53 -0800 | [diff] [blame] | 81 | LOCAL_MODULE_TAGS := debug | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 82 |  | 
| Benoit Goby | ed7bc3f | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 83 | LOCAL_STATIC_LIBRARIES := libzipfile libunz libcrypto_static $(EXTRA_STATIC_LIBS) | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 84 | ifeq ($(USE_SYSDEPS_WIN32),) | 
 | 85 | 	LOCAL_STATIC_LIBRARIES += libcutils | 
 | 86 | endif | 
 | 87 |  | 
| Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame^] | 88 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 89 | include $(BUILD_HOST_EXECUTABLE) | 
 | 90 |  | 
| Ying Wang | 9dc5069 | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 91 | $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 92 |  | 
 | 93 | ifeq ($(HOST_OS),windows) | 
| Raphael | 121c4ec | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 94 | $(LOCAL_INSTALLED_MODULE): \ | 
 | 95 |     $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ | 
 | 96 |     $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 97 | endif | 
 | 98 |  | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 99 |  | 
 | 100 | # adbd device daemon | 
 | 101 | # ========================================================= | 
 | 102 |  | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 103 | include $(CLEAR_VARS) | 
 | 104 |  | 
 | 105 | LOCAL_SRC_FILES := \ | 
 | 106 | 	adb.c \ | 
| David 'Digit' Turner | b1c2c95 | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 107 | 	fdevent.c \ | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 108 | 	transport.c \ | 
 | 109 | 	transport_local.c \ | 
 | 110 | 	transport_usb.c \ | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 111 | 	adb_auth_client.c \ | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 112 | 	sockets.c \ | 
 | 113 | 	services.c \ | 
 | 114 | 	file_sync_service.c \ | 
 | 115 | 	jdwp_service.c \ | 
 | 116 | 	framebuffer_service.c \ | 
 | 117 | 	remount_service.c \ | 
| Mark Salyzyn | ea06716 | 2013-12-10 12:37:57 -0800 | [diff] [blame] | 118 | 	usb_linux_client.c | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 119 |  | 
| Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame^] | 120 | LOCAL_CFLAGS := \ | 
 | 121 | 	-O2 \ | 
 | 122 | 	-g \ | 
 | 123 | 	-DADB_HOST=0 \ | 
 | 124 | 	-D_XOPEN_SOURCE \ | 
 | 125 | 	-D_GNU_SOURCE \ | 
 | 126 | 	-Wall -Wno-unused-parameter -Werror -Wno-deprecated-declarations \ | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 127 |  | 
| Nick Kralevich | 0926403 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 128 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) | 
 | 129 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 | 
 | 130 | endif | 
 | 131 |  | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 132 | LOCAL_MODULE := adbd | 
 | 133 |  | 
 | 134 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 
 | 135 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) | 
 | 136 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) | 
 | 137 |  | 
| Liang Cheng | 155c49a | 2014-01-02 18:27:51 -0800 | [diff] [blame] | 138 | LOCAL_STATIC_LIBRARIES := liblog libcutils libc libmincrypt libselinux | 
| Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame^] | 139 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | 
| Jeff Brown | f5287b7 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 140 | include $(BUILD_EXECUTABLE) | 
| The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 141 |  | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 142 |  | 
 | 143 | # adb host tool for device-as-host | 
 | 144 | # ========================================================= | 
| Benoit Goby | 097e2df | 2010-10-06 18:30:55 -0700 | [diff] [blame] | 145 | ifneq ($(SDK_ONLY),true) | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 146 | include $(CLEAR_VARS) | 
 | 147 |  | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 148 | LOCAL_SRC_FILES := \ | 
 | 149 | 	adb.c \ | 
 | 150 | 	console.c \ | 
 | 151 | 	transport.c \ | 
 | 152 | 	transport_local.c \ | 
 | 153 | 	transport_usb.c \ | 
 | 154 | 	commandline.c \ | 
 | 155 | 	adb_client.c \ | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 156 | 	adb_auth_host.c \ | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 157 | 	sockets.c \ | 
 | 158 | 	services.c \ | 
 | 159 | 	file_sync_client.c \ | 
 | 160 | 	get_my_path_linux.c \ | 
 | 161 | 	usb_linux.c \ | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 162 | 	usb_vendors.c \ | 
 | 163 | 	fdevent.c | 
 | 164 |  | 
 | 165 | LOCAL_CFLAGS := \ | 
 | 166 | 	-O2 \ | 
 | 167 | 	-g \ | 
 | 168 | 	-DADB_HOST=1 \ | 
 | 169 | 	-DADB_HOST_ON_TARGET=1 \ | 
| Mark Salyzyn | 63e39f2 | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 170 | 	-Wall -Wno-unused-parameter -Werror \ | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 171 | 	-D_XOPEN_SOURCE \ | 
 | 172 | 	-D_GNU_SOURCE | 
 | 173 |  | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 174 | LOCAL_C_INCLUDES += external/openssl/include | 
 | 175 |  | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 176 | LOCAL_MODULE := adb | 
 | 177 |  | 
 | 178 | LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils | 
 | 179 |  | 
| Benoit Goby | 2cc19e4 | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 180 | LOCAL_SHARED_LIBRARIES := libcrypto | 
 | 181 |  | 
| Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame^] | 182 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk | 
| John Michelau | 8733752 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 183 | include $(BUILD_EXECUTABLE) | 
| Benoit Goby | aa082e7 | 2010-10-06 17:11:59 -0700 | [diff] [blame] | 184 | endif |