| The Android Open Source Project | dd7bc33 | 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 | dd7bc33 | 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 | 9c60755 | 2013-01-01 15:24:33 +0800 | [diff] [blame] | 19 |   LOCAL_LDLIBS += -lrt -ldl -lpthread | 
| JP Abgrall | 571c136 | 2012-12-06 18:18:12 -0800 | [diff] [blame] | 20 |   LOCAL_CFLAGS += -DWORKAROUND_BUG6558362 | 
| The Android Open Source Project | dd7bc33 | 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 | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 26 |   LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | endif | 
 | 28 |  | 
| Alexey Tarasov | 3b226f9 | 2009-10-25 01:37:37 +1100 | [diff] [blame] | 29 | ifeq ($(HOST_OS),freebsd) | 
 | 30 |   USB_SRCS := usb_libusb.c | 
 | 31 |   EXTRA_SRCS := get_my_path_freebsd.c | 
 | 32 |   LOCAL_LDLIBS += -lpthread -lusb | 
 | 33 | endif | 
 | 34 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 35 | ifeq ($(HOST_OS),windows) | 
 | 36 |   USB_SRCS := usb_windows.c | 
| Mark Salyzyn | c788278 | 2013-12-06 15:50:48 -0800 | [diff] [blame] | 37 |   EXTRA_SRCS := get_my_path_windows.c | 
| Benoit Goby | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 38 |   EXTRA_STATIC_LIBS := AdbWinApi | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 39 |   ifneq ($(strip $(USE_CYGWIN)),) | 
| Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 40 |     # Pure cygwin case | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 41 |     LOCAL_LDLIBS += -lpthread -lgdi32 | 
| Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 42 |     LOCAL_C_INCLUDES += /usr/include/w32api/ddk | 
 | 43 |   endif | 
 | 44 |   ifneq ($(strip $(USE_MINGW)),) | 
 | 45 |     # MinGW under Linux case | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 46 |     LOCAL_LDLIBS += -lws2_32 -lgdi32 | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 47 |     USE_SYSDEPS_WIN32 := 1 | 
| Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 48 |     LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 49 |   endif | 
| Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 50 |   LOCAL_C_INCLUDES += development/host/windows/usb/api/ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 | endif | 
 | 52 |  | 
 | 53 | LOCAL_SRC_FILES := \ | 
 | 54 | 	adb.c \ | 
 | 55 | 	console.c \ | 
 | 56 | 	transport.c \ | 
 | 57 | 	transport_local.c \ | 
 | 58 | 	transport_usb.c \ | 
 | 59 | 	commandline.c \ | 
 | 60 | 	adb_client.c \ | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 61 | 	adb_auth_host.c \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 62 | 	sockets.c \ | 
 | 63 | 	services.c \ | 
 | 64 | 	file_sync_client.c \ | 
 | 65 | 	$(EXTRA_SRCS) \ | 
 | 66 | 	$(USB_SRCS) \ | 
| Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 67 | 	usb_vendors.c | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 68 |  | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 69 | LOCAL_C_INCLUDES += external/openssl/include | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 |  | 
 | 71 | ifneq ($(USE_SYSDEPS_WIN32),) | 
 | 72 |   LOCAL_SRC_FILES += sysdeps_win32.c | 
| David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 73 | else | 
 | 74 |   LOCAL_SRC_FILES += fdevent.c | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | endif | 
 | 76 |  | 
| Mark Salyzyn | 60299df | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 77 | LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror | 
| Jack Palevich | 7fe202f | 2010-05-25 14:49:57 +0800 | [diff] [blame] | 78 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 79 | LOCAL_MODULE := adb | 
| Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 80 | LOCAL_MODULE_TAGS := debug | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 81 |  | 
| Benoit Goby | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 82 | LOCAL_STATIC_LIBRARIES := libzipfile libunz libcrypto_static $(EXTRA_STATIC_LIBS) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 83 | ifeq ($(USE_SYSDEPS_WIN32),) | 
 | 84 | 	LOCAL_STATIC_LIBRARIES += libcutils | 
 | 85 | endif | 
 | 86 |  | 
 | 87 | include $(BUILD_HOST_EXECUTABLE) | 
 | 88 |  | 
| Ying Wang | 96535ba | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 89 | $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 90 |  | 
 | 91 | ifeq ($(HOST_OS),windows) | 
| Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 92 | $(LOCAL_INSTALLED_MODULE): \ | 
 | 93 |     $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ | 
 | 94 |     $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 95 | endif | 
 | 96 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 97 |  | 
 | 98 | # adbd device daemon | 
 | 99 | # ========================================================= | 
 | 100 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 101 | include $(CLEAR_VARS) | 
 | 102 |  | 
 | 103 | LOCAL_SRC_FILES := \ | 
 | 104 | 	adb.c \ | 
| Christopher Tate | d2f5415 | 2011-04-21 12:53:28 -0700 | [diff] [blame] | 105 | 	backup_service.c \ | 
| David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 106 | 	fdevent.c \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 107 | 	transport.c \ | 
 | 108 | 	transport_local.c \ | 
 | 109 | 	transport_usb.c \ | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 110 | 	adb_auth_client.c \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 111 | 	sockets.c \ | 
 | 112 | 	services.c \ | 
 | 113 | 	file_sync_service.c \ | 
 | 114 | 	jdwp_service.c \ | 
 | 115 | 	framebuffer_service.c \ | 
 | 116 | 	remount_service.c \ | 
| Mark Salyzyn | 7aa39a7 | 2013-12-10 12:37:57 -0800 | [diff] [blame] | 117 | 	usb_linux_client.c | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 118 |  | 
| Mark Salyzyn | 60299df | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 119 | LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter -Werror | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 120 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE | 
 | 121 |  | 
| Nick Kralevich | 5890fe3 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 122 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) | 
 | 123 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 | 
 | 124 | endif | 
 | 125 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 126 | LOCAL_MODULE := adbd | 
 | 127 |  | 
 | 128 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 
 | 129 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) | 
 | 130 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) | 
 | 131 |  | 
| Liang Cheng | 20d33f4 | 2014-01-02 18:27:51 -0800 | [diff] [blame] | 132 | LOCAL_STATIC_LIBRARIES := liblog libcutils libc libmincrypt libselinux | 
| Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 133 | include $(BUILD_EXECUTABLE) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 134 |  | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 135 |  | 
 | 136 | # adb host tool for device-as-host | 
 | 137 | # ========================================================= | 
| Benoit Goby | dff0237 | 2010-10-06 18:30:55 -0700 | [diff] [blame] | 138 | ifneq ($(SDK_ONLY),true) | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 139 | include $(CLEAR_VARS) | 
 | 140 |  | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 141 | LOCAL_SRC_FILES := \ | 
 | 142 | 	adb.c \ | 
 | 143 | 	console.c \ | 
 | 144 | 	transport.c \ | 
 | 145 | 	transport_local.c \ | 
 | 146 | 	transport_usb.c \ | 
 | 147 | 	commandline.c \ | 
 | 148 | 	adb_client.c \ | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 149 | 	adb_auth_host.c \ | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 150 | 	sockets.c \ | 
 | 151 | 	services.c \ | 
 | 152 | 	file_sync_client.c \ | 
 | 153 | 	get_my_path_linux.c \ | 
 | 154 | 	usb_linux.c \ | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 155 | 	usb_vendors.c \ | 
 | 156 | 	fdevent.c | 
 | 157 |  | 
 | 158 | LOCAL_CFLAGS := \ | 
 | 159 | 	-O2 \ | 
 | 160 | 	-g \ | 
 | 161 | 	-DADB_HOST=1 \ | 
 | 162 | 	-DADB_HOST_ON_TARGET=1 \ | 
| Mark Salyzyn | 60299df | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 163 | 	-Wall -Wno-unused-parameter -Werror \ | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 164 | 	-D_XOPEN_SOURCE \ | 
 | 165 | 	-D_GNU_SOURCE | 
 | 166 |  | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 167 | LOCAL_C_INCLUDES += external/openssl/include | 
 | 168 |  | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 169 | LOCAL_MODULE := adb | 
 | 170 |  | 
 | 171 | LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils | 
 | 172 |  | 
| Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 173 | LOCAL_SHARED_LIBRARIES := libcrypto | 
 | 174 |  | 
| John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 175 | include $(BUILD_EXECUTABLE) | 
| Benoit Goby | cb56b71 | 2010-10-06 17:11:59 -0700 | [diff] [blame] | 176 | endif |