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