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 |
Tim Murray | 1efcdef | 2014-07-24 18:33:12 -0700 | [diff] [blame] | 27 | LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 28 | endif |
| 29 | |
Alexey Tarasov | 3b226f9 | 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 | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 36 | ifeq ($(HOST_OS),windows) |
| 37 | USB_SRCS := usb_windows.c |
Mark Salyzyn | c788278 | 2013-12-06 15:50:48 -0800 | [diff] [blame] | 38 | EXTRA_SRCS := get_my_path_windows.c |
Benoit Goby | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 39 | EXTRA_STATIC_LIBS := AdbWinApi |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 | ifneq ($(strip $(USE_CYGWIN)),) |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 41 | # Pure cygwin case |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 42 | LOCAL_LDLIBS += -lpthread -lgdi32 |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 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 |
| 48 | endif |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 49 | LOCAL_C_INCLUDES += development/host/windows/usb/api/ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 50 | endif |
| 51 | |
| 52 | LOCAL_SRC_FILES := \ |
| 53 | adb.c \ |
| 54 | console.c \ |
| 55 | transport.c \ |
| 56 | transport_local.c \ |
| 57 | transport_usb.c \ |
| 58 | commandline.c \ |
| 59 | adb_client.c \ |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 60 | adb_auth_host.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 61 | sockets.c \ |
| 62 | services.c \ |
| 63 | file_sync_client.c \ |
| 64 | $(EXTRA_SRCS) \ |
| 65 | $(USB_SRCS) \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 66 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 67 | ifneq ($(USE_SYSDEPS_WIN32),) |
| 68 | LOCAL_SRC_FILES += sysdeps_win32.c |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 69 | else |
| 70 | LOCAL_SRC_FILES += fdevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 | endif |
| 72 | |
Stephen Hines | 3ea87c3 | 2014-10-01 17:16:37 -0700 | [diff] [blame] | 73 | LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror |
Jack Palevich | 7fe202f | 2010-05-25 14:49:57 +0800 | [diff] [blame] | 74 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | LOCAL_MODULE := adb |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 76 | LOCAL_MODULE_TAGS := debug |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 | |
Trevor Drake | b79a2d5 | 2014-12-07 15:13:29 +0000 | [diff] [blame] | 78 | LOCAL_STATIC_LIBRARIES := libzipfile libz libcrypto_static $(EXTRA_STATIC_LIBS) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 79 | ifeq ($(USE_SYSDEPS_WIN32),) |
| 80 | LOCAL_STATIC_LIBRARIES += libcutils |
| 81 | endif |
| 82 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 83 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 84 | include $(BUILD_HOST_EXECUTABLE) |
| 85 | |
Ying Wang | 96535ba | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 86 | $(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] | 87 | |
| 88 | ifeq ($(HOST_OS),windows) |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 89 | $(LOCAL_INSTALLED_MODULE): \ |
| 90 | $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ |
| 91 | $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 92 | endif |
| 93 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 94 | |
| 95 | # adbd device daemon |
| 96 | # ========================================================= |
| 97 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 98 | include $(CLEAR_VARS) |
| 99 | |
| 100 | LOCAL_SRC_FILES := \ |
| 101 | adb.c \ |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 102 | fdevent.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 103 | transport.c \ |
| 104 | transport_local.c \ |
| 105 | transport_usb.c \ |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 106 | adb_auth_client.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 107 | sockets.c \ |
| 108 | services.c \ |
| 109 | file_sync_service.c \ |
| 110 | jdwp_service.c \ |
| 111 | framebuffer_service.c \ |
| 112 | remount_service.c \ |
Paul Lawrence | 982089d | 2014-12-03 15:31:57 -0800 | [diff] [blame] | 113 | set_verity_enable_state_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 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 116 | LOCAL_CFLAGS := \ |
| 117 | -O2 \ |
| 118 | -g \ |
| 119 | -DADB_HOST=0 \ |
| 120 | -D_XOPEN_SOURCE \ |
| 121 | -D_GNU_SOURCE \ |
| 122 | -Wall -Wno-unused-parameter -Werror -Wno-deprecated-declarations \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 123 | |
Nick Kralevich | 5890fe3 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 124 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
| 125 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
| 126 | endif |
| 127 | |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 128 | ifneq (,$(filter userdebug,$(TARGET_BUILD_VARIANT))) |
| 129 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
| 130 | endif |
| 131 | |
The Android Open Source Project | dd7bc33 | 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) |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 137 | LOCAL_C_INCLUDES += system/extras/ext4_utils system/core/fs_mgr/include |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 138 | |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 139 | LOCAL_STATIC_LIBRARIES := liblog \ |
| 140 | libfs_mgr \ |
| 141 | libcutils \ |
| 142 | libc \ |
| 143 | libmincrypt \ |
| 144 | libselinux \ |
| 145 | libext4_utils_static |
| 146 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 147 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 148 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 149 | include $(BUILD_EXECUTABLE) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 150 | |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 151 | |
| 152 | # adb host tool for device-as-host |
| 153 | # ========================================================= |
Benoit Goby | dff0237 | 2010-10-06 18:30:55 -0700 | [diff] [blame] | 154 | ifneq ($(SDK_ONLY),true) |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 155 | include $(CLEAR_VARS) |
| 156 | |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 157 | LOCAL_SRC_FILES := \ |
| 158 | adb.c \ |
| 159 | console.c \ |
| 160 | transport.c \ |
| 161 | transport_local.c \ |
| 162 | transport_usb.c \ |
| 163 | commandline.c \ |
| 164 | adb_client.c \ |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 165 | adb_auth_host.c \ |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 166 | sockets.c \ |
| 167 | services.c \ |
| 168 | file_sync_client.c \ |
| 169 | get_my_path_linux.c \ |
| 170 | usb_linux.c \ |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 171 | fdevent.c |
| 172 | |
| 173 | LOCAL_CFLAGS := \ |
| 174 | -O2 \ |
| 175 | -g \ |
| 176 | -DADB_HOST=1 \ |
| 177 | -DADB_HOST_ON_TARGET=1 \ |
Mark Salyzyn | 60299df | 2014-04-30 09:10:31 -0700 | [diff] [blame] | 178 | -Wall -Wno-unused-parameter -Werror \ |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 179 | -D_XOPEN_SOURCE \ |
| 180 | -D_GNU_SOURCE |
| 181 | |
| 182 | LOCAL_MODULE := adb |
| 183 | |
Trevor Drake | b79a2d5 | 2014-12-07 15:13:29 +0000 | [diff] [blame] | 184 | LOCAL_STATIC_LIBRARIES := libzipfile libz libcutils liblog |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 185 | |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 186 | LOCAL_SHARED_LIBRARIES := libcrypto |
| 187 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 188 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 189 | include $(BUILD_EXECUTABLE) |
Benoit Goby | cb56b71 | 2010-10-06 17:11:59 -0700 | [diff] [blame] | 190 | endif |