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 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 8 | adb_host_sanitize := |
| 9 | adb_target_sanitize := |
| 10 | |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 11 | adb_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android |
| 12 | |
| 13 | ADB_COMMON_CFLAGS := \ |
Dan Albert | c6d3a24 | 2015-05-20 18:56:10 -0700 | [diff] [blame] | 14 | -Wall -Wextra -Werror \ |
Dan Albert | 7d8fc46 | 2015-07-08 13:50:42 -0700 | [diff] [blame] | 15 | -Wno-unused-parameter \ |
Dan Albert | 3d978e6 | 2015-07-09 20:35:09 +0000 | [diff] [blame] | 16 | -Wno-missing-field-initializers \ |
Elliott Hughes | 6c73bfc | 2015-10-27 13:40:35 -0700 | [diff] [blame] | 17 | -Wvla \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 18 | -DADB_REVISION='"$(adb_version)"' \ |
| 19 | |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 20 | ADB_COMMON_linux_CFLAGS := \ |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 21 | -Wexit-time-destructors \ |
| 22 | |
| 23 | ADB_COMMON_darwin_CFLAGS := \ |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 24 | -Wexit-time-destructors \ |
| 25 | |
Spencer Low | cc467f1 | 2015-08-02 18:13:54 -0700 | [diff] [blame] | 26 | # Define windows.h and tchar.h Unicode preprocessor symbols so that |
| 27 | # CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the |
| 28 | # build if you accidentally pass char*. Fix by calling like: |
Spencer Low | 50f5bf1 | 2015-11-12 15:20:15 -0800 | [diff] [blame] | 29 | # std::wstring path_wide; |
| 30 | # if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ } |
| 31 | # CreateFileW(path_wide.c_str()); |
Spencer Low | cc467f1 | 2015-08-02 18:13:54 -0700 | [diff] [blame] | 32 | ADB_COMMON_windows_CFLAGS := \ |
| 33 | -DUNICODE=1 -D_UNICODE=1 \ |
| 34 | |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 35 | # libadb |
| 36 | # ========================================================= |
| 37 | |
| 38 | # Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes |
| 39 | # made to adb rarely get ported to the other two, so the trees have diverged a |
| 40 | # bit. We'd like to stop this because it is a maintenance nightmare, but the |
| 41 | # divergence makes this difficult to do all at once. For now, we will start |
| 42 | # small by moving common files into a static library. Hopefully some day we can |
| 43 | # get enough of adb in here that we no longer need minadb. https://b/17626262 |
Dan Albert | 056ad0e | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 44 | LIBADB_SRC_FILES := \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 45 | adb.cpp \ |
Dan Albert | 66a91b0 | 2015-02-24 21:26:58 -0800 | [diff] [blame] | 46 | adb_io.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 47 | adb_listeners.cpp \ |
Yabin Cui | 19bec5b | 2015-09-22 15:52:57 -0700 | [diff] [blame] | 48 | adb_trace.cpp \ |
Elliott Hughes | 3810445 | 2015-04-17 13:57:15 -0700 | [diff] [blame] | 49 | adb_utils.cpp \ |
Josh Gao | e738812 | 2016-02-16 17:34:53 -0800 | [diff] [blame] | 50 | fdevent.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 51 | sockets.cpp \ |
Josh Gao | 4a5a95d | 2016-08-24 18:38:44 -0700 | [diff] [blame] | 52 | socket_spec.cpp \ |
Josh Gao | a2cf375 | 2016-12-05 17:11:34 -0800 | [diff] [blame] | 53 | sysdeps/errno.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 54 | transport.cpp \ |
| 55 | transport_local.cpp \ |
| 56 | transport_usb.cpp \ |
Dan Albert | 056ad0e | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 57 | |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 58 | LIBADB_TEST_SRCS := \ |
| 59 | adb_io_test.cpp \ |
David Pursell | 19d0c23 | 2016-04-07 11:25:48 -0700 | [diff] [blame] | 60 | adb_listeners_test.cpp \ |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 61 | adb_utils_test.cpp \ |
Josh Gao | 511763b | 2016-02-10 14:49:00 -0800 | [diff] [blame] | 62 | fdevent_test.cpp \ |
Josh Gao | 3fb517c | 2016-09-19 17:31:55 -0700 | [diff] [blame] | 63 | socket_spec_test.cpp \ |
Josh Gao | 511763b | 2016-02-10 14:49:00 -0800 | [diff] [blame] | 64 | socket_test.cpp \ |
Josh Gao | a4f5e03 | 2016-02-09 14:59:09 -0800 | [diff] [blame] | 65 | sysdeps_test.cpp \ |
Josh Gao | a4f9c17 | 2016-07-28 18:09:48 -0700 | [diff] [blame] | 66 | sysdeps/stat_test.cpp \ |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 67 | transport_test.cpp \ |
| 68 | |
Dan Albert | 357bd49 | 2015-02-20 17:20:09 -0800 | [diff] [blame] | 69 | LIBADB_CFLAGS := \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 70 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | 056ad0e | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 71 | -fvisibility=hidden \ |
Elliott Hughes | bb4fe4a | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 72 | |
| 73 | LIBADB_linux_CFLAGS := \ |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 74 | $(ADB_COMMON_linux_CFLAGS) \ |
| 75 | |
| 76 | LIBADB_darwin_CFLAGS := \ |
| 77 | $(ADB_COMMON_darwin_CFLAGS) \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 78 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 79 | LIBADB_windows_CFLAGS := \ |
| 80 | $(ADB_COMMON_windows_CFLAGS) \ |
Elliott Hughes | bb4fe4a | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 81 | |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 82 | LIBADB_darwin_SRC_FILES := \ |
David Pursell | c25a34e | 2016-02-22 14:27:23 -0800 | [diff] [blame] | 83 | sysdeps_unix.cpp \ |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 84 | client/usb_dispatch.cpp \ |
| 85 | client/usb_libusb.cpp \ |
Josh Gao | 78f860e | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 86 | client/usb_osx.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 87 | |
| 88 | LIBADB_linux_SRC_FILES := \ |
David Pursell | c25a34e | 2016-02-22 14:27:23 -0800 | [diff] [blame] | 89 | sysdeps_unix.cpp \ |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 90 | client/usb_dispatch.cpp \ |
| 91 | client/usb_libusb.cpp \ |
Josh Gao | 78f860e | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 92 | client/usb_linux.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 93 | |
| 94 | LIBADB_windows_SRC_FILES := \ |
Elliott Hughes | 6a09693 | 2015-04-16 16:47:02 -0700 | [diff] [blame] | 95 | sysdeps_win32.cpp \ |
Josh Gao | 75e96bb | 2016-12-05 13:24:48 -0800 | [diff] [blame] | 96 | sysdeps/win32/errno.cpp \ |
Josh Gao | a4f9c17 | 2016-07-28 18:09:48 -0700 | [diff] [blame] | 97 | sysdeps/win32/stat.cpp \ |
Josh Gao | 78f860e | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 98 | client/usb_windows.cpp \ |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 99 | |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 100 | LIBADB_TEST_windows_SRCS := \ |
Josh Gao | 75e96bb | 2016-12-05 13:24:48 -0800 | [diff] [blame] | 101 | sysdeps/win32/errno_test.cpp \ |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 102 | sysdeps_win32_test.cpp \ |
| 103 | |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 104 | include $(CLEAR_VARS) |
Elliott Hughes | 392692c | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 105 | LOCAL_CLANG := true |
Josh Gao | 484aaba | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 106 | LOCAL_MODULE := libadbd_usb |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 107 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
Josh Gao | 484aaba | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 108 | LOCAL_SRC_FILES := daemon/usb.cpp |
Dan Albert | 052c253 | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 109 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 110 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Elliott Hughes | a585cbd | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 111 | |
Dan Albert | 27929b0 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 112 | # Even though we're building a static library (and thus there's no link step for |
| 113 | # this to take effect), this adds the includes to our path. |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 114 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
Dan Albert | 27929b0 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 115 | |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 116 | include $(BUILD_STATIC_LIBRARY) |
| 117 | |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 118 | include $(CLEAR_VARS) |
Josh Gao | 484aaba | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 119 | LOCAL_CLANG := true |
| 120 | LOCAL_MODULE := libadbd |
| 121 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
| 122 | LOCAL_SRC_FILES := \ |
| 123 | $(LIBADB_SRC_FILES) \ |
| 124 | adbd_auth.cpp \ |
| 125 | jdwp_service.cpp \ |
| 126 | |
| 127 | LOCAL_SANITIZE := $(adb_target_sanitize) |
| 128 | |
| 129 | # Even though we're building a static library (and thus there's no link step for |
| 130 | # this to take effect), this adds the includes to our path. |
| 131 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
| 132 | |
| 133 | LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb |
| 134 | |
| 135 | include $(BUILD_STATIC_LIBRARY) |
| 136 | |
| 137 | include $(CLEAR_VARS) |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 138 | LOCAL_MODULE := libadb |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 139 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 140 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 141 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 142 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 143 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
Dan Albert | 01c58ca | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 144 | LOCAL_SRC_FILES := \ |
| 145 | $(LIBADB_SRC_FILES) \ |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 146 | adb_auth_host.cpp \ |
| 147 | transport_mdns.cpp \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 148 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 149 | LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES) |
| 150 | LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES) |
| 151 | LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES) |
| 152 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 153 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Elliott Hughes | a585cbd | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 154 | |
Dan Albert | 01c58ca | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 155 | # Even though we're building a static library (and thus there's no link step for |
Dan Albert | 27929b0 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 156 | # this to take effect), this adds the includes to our path. |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 157 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd |
| 158 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 159 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
Dan Albert | 01c58ca | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 160 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 161 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/ |
Dan Willemsen | 74e8568 | 2015-09-03 20:29:56 -0700 | [diff] [blame] | 162 | LOCAL_MULTILIB := first |
Dan Albert | 8ce3213 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 163 | |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 164 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 165 | |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 166 | include $(CLEAR_VARS) |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 167 | LOCAL_CLANG := true |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 168 | LOCAL_MODULE := adbd_test |
| 169 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) |
Yabin Cui | 7c92f0a | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 170 | LOCAL_SRC_FILES := \ |
| 171 | $(LIBADB_TEST_SRCS) \ |
| 172 | $(LIBADB_TEST_linux_SRCS) \ |
David Pursell | 8da19a4 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 173 | shell_service.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 174 | shell_service_protocol.cpp \ |
| 175 | shell_service_protocol_test.cpp \ |
David Pursell | 8da19a4 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 176 | shell_service_test.cpp \ |
Yabin Cui | 7c92f0a | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 177 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 178 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 179 | LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd |
Dimitry Ivanov | 53b3ac5 | 2016-02-12 18:40:29 -0800 | [diff] [blame] | 180 | LOCAL_SHARED_LIBRARIES := liblog libbase libcutils |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 181 | include $(BUILD_NATIVE_TEST) |
| 182 | |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 183 | # libdiagnose_usb |
| 184 | # ========================================================= |
| 185 | |
| 186 | include $(CLEAR_VARS) |
| 187 | LOCAL_MODULE := libdiagnose_usb |
| 188 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 189 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) |
| 190 | LOCAL_SRC_FILES := diagnose_usb.cpp |
| 191 | # Even though we're building a static library (and thus there's no link step for |
| 192 | # this to take effect), this adds the includes to our path. |
| 193 | LOCAL_STATIC_LIBRARIES := libbase |
| 194 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 195 | |
Spencer Low | c9ddd81 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 196 | # adb_test |
| 197 | # ========================================================= |
| 198 | |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 199 | include $(CLEAR_VARS) |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 200 | LOCAL_MODULE := adb_test |
Spencer Low | 639cea4 | 2015-09-07 23:39:02 -0700 | [diff] [blame] | 201 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 202 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 203 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 204 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 205 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 206 | LOCAL_SRC_FILES := \ |
| 207 | $(LIBADB_TEST_SRCS) \ |
Felipe Leme | 042c351 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 208 | adb_client.cpp \ |
| 209 | bugreport.cpp \ |
| 210 | bugreport_test.cpp \ |
Felipe Leme | e53b12b | 2016-07-26 12:23:40 -0700 | [diff] [blame] | 211 | line_printer.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 212 | services.cpp \ |
| 213 | shell_service_protocol.cpp \ |
| 214 | shell_service_protocol_test.cpp \ |
| 215 | |
David Pursell | 7616ae1 | 2015-09-11 16:06:59 -0700 | [diff] [blame] | 216 | LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS) |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 217 | LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS) |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 218 | LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS) |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 219 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 220 | LOCAL_SHARED_LIBRARIES := libbase |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 221 | LOCAL_STATIC_LIBRARIES := \ |
| 222 | libadb \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 223 | libcrypto_utils \ |
| 224 | libcrypto \ |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 225 | libcutils \ |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 226 | libdiagnose_usb \ |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 227 | libmdnssd \ |
Casey Dahlin | 21a59b8 | 2016-07-19 14:18:54 -0700 | [diff] [blame] | 228 | libgmock_host |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 229 | |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 230 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 231 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
| 232 | |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 233 | # Set entrypoint to wmain from sysdeps_win32.cpp instead of main |
| 234 | LOCAL_LDFLAGS_windows := -municode |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 235 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 236 | LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 237 | LOCAL_LDLIBS_windows := -lws2_32 -luserenv |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 238 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 239 | |
Dan Willemsen | c6aa5d6 | 2015-12-21 16:14:31 -0800 | [diff] [blame] | 240 | LOCAL_MULTILIB := first |
| 241 | |
Spencer Low | c9ddd81 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 242 | include $(BUILD_HOST_NATIVE_TEST) |
| 243 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 244 | # adb host tool |
| 245 | # ========================================================= |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 246 | include $(CLEAR_VARS) |
| 247 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 248 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 249 | |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 250 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon -lobjc |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 251 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 252 | # Use wmain instead of main |
| 253 | LOCAL_LDFLAGS_windows := -municode |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 254 | LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 255 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
| 256 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi |
Dan Albert | 250e58c | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 257 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 258 | LOCAL_SRC_FILES := \ |
Elliott Hughes | f5cdc1d | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 259 | adb_client.cpp \ |
Felipe Leme | 042c351 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 260 | bugreport.cpp \ |
Dan Albert | 53a3744 | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 261 | client/main.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 262 | console.cpp \ |
| 263 | commandline.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 264 | file_sync_client.cpp \ |
Elliott Hughes | f5cdc1d | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 265 | line_printer.cpp \ |
| 266 | services.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 267 | shell_service_protocol.cpp \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 268 | |
Dan Albert | 50f9b90 | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 269 | LOCAL_CFLAGS += \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 270 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | 50f9b90 | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 271 | -D_GNU_SOURCE \ |
| 272 | -DADB_HOST=1 \ |
| 273 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 274 | LOCAL_CFLAGS_windows := \ |
| 275 | $(ADB_COMMON_windows_CFLAGS) |
| 276 | |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 277 | LOCAL_CFLAGS_linux := \ |
| 278 | $(ADB_COMMON_linux_CFLAGS) \ |
| 279 | |
| 280 | LOCAL_CFLAGS_darwin := \ |
| 281 | $(ADB_COMMON_darwin_CFLAGS) \ |
| 282 | -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \ |
| 283 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 284 | LOCAL_MODULE := adb |
Benoit Goby | 12dc369 | 2013-02-20 15:04:53 -0800 | [diff] [blame] | 285 | LOCAL_MODULE_TAGS := debug |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 286 | LOCAL_MODULE_HOST_OS := darwin linux windows |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 287 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 288 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 289 | LOCAL_STATIC_LIBRARIES := \ |
| 290 | libadb \ |
Elliott Hughes | 170b568 | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 291 | libbase \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 292 | libcrypto_utils \ |
| 293 | libcrypto \ |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 294 | libdiagnose_usb \ |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 295 | liblog \ |
| 296 | libmdnssd |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 297 | |
Josh Gao | f5570b8 | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 298 | # Don't use libcutils on Windows. |
| 299 | LOCAL_STATIC_LIBRARIES_darwin := libcutils |
Casey Dahlin | 20238f2 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 300 | LOCAL_STATIC_LIBRARIES_linux := libcutils |
Josh Gao | f5570b8 | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 301 | |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 302 | LOCAL_STATIC_LIBRARIES_darwin += libusb |
| 303 | LOCAL_STATIC_LIBRARIES_linux += libusb |
| 304 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 305 | LOCAL_CXX_STL := libc++_static |
Colin Cross | 0a34bfb | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 306 | |
| 307 | # Don't add anything here, we don't want additional shared dependencies |
| 308 | # on the host adb tool, and shared libraries that link against libc++ |
| 309 | # will violate ODR |
| 310 | LOCAL_SHARED_LIBRARIES := |
| 311 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 312 | include $(BUILD_HOST_EXECUTABLE) |
| 313 | |
Ying Wang | 458321a | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 314 | $(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE)) |
| 315 | ifdef HOST_CROSS_OS |
| 316 | # Archive adb.exe for win_sdk build. |
| 317 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT)) |
| 318 | endif |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 319 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 320 | |
| 321 | # adbd device daemon |
| 322 | # ========================================================= |
| 323 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 324 | include $(CLEAR_VARS) |
| 325 | |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 326 | LOCAL_CLANG := true |
Dan Albert | 250e58c | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 327 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 328 | LOCAL_SRC_FILES := \ |
Dan Albert | 53a3744 | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 329 | daemon/main.cpp \ |
Casey Dahlin | 10ad15f | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 330 | daemon/mdns.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 331 | services.cpp \ |
| 332 | file_sync_service.cpp \ |
| 333 | framebuffer_service.cpp \ |
| 334 | remount_service.cpp \ |
| 335 | set_verity_enable_state_service.cpp \ |
David Pursell | 4f344bb | 2015-08-28 15:08:49 -0700 | [diff] [blame] | 336 | shell_service.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 337 | shell_service_protocol.cpp \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 338 | |
Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 339 | LOCAL_CFLAGS := \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 340 | $(ADB_COMMON_CFLAGS) \ |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 341 | $(ADB_COMMON_linux_CFLAGS) \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 342 | -DADB_HOST=0 \ |
| 343 | -D_GNU_SOURCE \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 344 | -Wno-deprecated-declarations \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 345 | |
Elliott Hughes | d7eb854 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 346 | LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0) |
Nick Kralevich | 0926403 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 347 | |
Elliott Hughes | dedf767 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 348 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 349 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
Elliott Hughes | d7eb854 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 350 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 351 | endif |
| 352 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 353 | LOCAL_MODULE := adbd |
| 354 | |
| 355 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 356 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 357 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 358 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 359 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Josh Gao | ab5449d | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 360 | LOCAL_STRIP_MODULE := keep_symbols |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 361 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 362 | libadbd \ |
Tao Bao | 0db6764 | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 363 | libbase \ |
Tao Bao | a8c21dc | 2017-01-05 18:01:01 -0800 | [diff] [blame] | 364 | libbootloader_message \ |
Dan Albert | 0ca996b | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 365 | libfs_mgr \ |
Sami Tolvanen | 778f500 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 366 | libfec \ |
| 367 | libfec_rs \ |
William Roberts | 075c852 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 368 | libselinux \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 369 | liblog \ |
Alex Deymo | f2c8699 | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 370 | libext4_utils \ |
Sami Tolvanen | 778f500 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 371 | libsquashfs_utils \ |
Dan Albert | 27929b0 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 372 | libcutils \ |
| 373 | libbase \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 374 | libcrypto_utils \ |
| 375 | libcrypto \ |
Josh Gao | ab5449d | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 376 | libminijail \ |
Casey Dahlin | 10ad15f | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 377 | libmdnssd \ |
Josh Gao | 690b0a9 | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 378 | libdebuggerd_handler \ |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 379 | |
Jeff Brown | f5287b7 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 380 | include $(BUILD_EXECUTABLE) |
Josh Gao | 484aaba | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 381 | |
| 382 | include $(call first-makefiles-under,$(LOCAL_PATH)) |