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) \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 146 | adb_auth_host.cpp \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 147 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 148 | LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES) |
| 149 | LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES) |
| 150 | LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES) |
| 151 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 152 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Elliott Hughes | a585cbd | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 153 | |
Dan Albert | 01c58ca | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 154 | # 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] | 155 | # this to take effect), this adds the includes to our path. |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 156 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 157 | LOCAL_STATIC_LIBRARIES_linux := libusb |
| 158 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
Dan Albert | 01c58ca | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 159 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 160 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/ |
Dan Willemsen | 74e8568 | 2015-09-03 20:29:56 -0700 | [diff] [blame] | 161 | LOCAL_MULTILIB := first |
Dan Albert | 8ce3213 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 162 | |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 163 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 164 | |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 165 | include $(CLEAR_VARS) |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 166 | LOCAL_CLANG := true |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 167 | LOCAL_MODULE := adbd_test |
| 168 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) |
Yabin Cui | 7c92f0a | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 169 | LOCAL_SRC_FILES := \ |
| 170 | $(LIBADB_TEST_SRCS) \ |
| 171 | $(LIBADB_TEST_linux_SRCS) \ |
David Pursell | 8da19a4 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 172 | shell_service.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 173 | shell_service_protocol.cpp \ |
| 174 | shell_service_protocol_test.cpp \ |
David Pursell | 8da19a4 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 175 | shell_service_test.cpp \ |
Yabin Cui | 7c92f0a | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 176 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 177 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 178 | LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb |
Dimitry Ivanov | 53b3ac5 | 2016-02-12 18:40:29 -0800 | [diff] [blame] | 179 | LOCAL_SHARED_LIBRARIES := liblog libbase libcutils |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 180 | include $(BUILD_NATIVE_TEST) |
| 181 | |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 182 | # libdiagnose_usb |
| 183 | # ========================================================= |
| 184 | |
| 185 | include $(CLEAR_VARS) |
| 186 | LOCAL_MODULE := libdiagnose_usb |
| 187 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 188 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) |
| 189 | LOCAL_SRC_FILES := diagnose_usb.cpp |
| 190 | # Even though we're building a static library (and thus there's no link step for |
| 191 | # this to take effect), this adds the includes to our path. |
| 192 | LOCAL_STATIC_LIBRARIES := libbase |
| 193 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 194 | |
Spencer Low | c9ddd81 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 195 | # adb_test |
| 196 | # ========================================================= |
| 197 | |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 198 | include $(CLEAR_VARS) |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 199 | LOCAL_MODULE := adb_test |
Spencer Low | 639cea4 | 2015-09-07 23:39:02 -0700 | [diff] [blame] | 200 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 201 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 202 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 203 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 204 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 205 | LOCAL_SRC_FILES := \ |
| 206 | $(LIBADB_TEST_SRCS) \ |
Felipe Leme | 042c351 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 207 | adb_client.cpp \ |
| 208 | bugreport.cpp \ |
| 209 | bugreport_test.cpp \ |
Felipe Leme | e53b12b | 2016-07-26 12:23:40 -0700 | [diff] [blame] | 210 | line_printer.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 211 | services.cpp \ |
| 212 | shell_service_protocol.cpp \ |
| 213 | shell_service_protocol_test.cpp \ |
| 214 | |
David Pursell | 7616ae1 | 2015-09-11 16:06:59 -0700 | [diff] [blame] | 215 | LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS) |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 216 | LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS) |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 217 | LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS) |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 218 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 219 | LOCAL_SHARED_LIBRARIES := libbase |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 220 | LOCAL_STATIC_LIBRARIES := \ |
| 221 | libadb \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 222 | libcrypto_utils \ |
| 223 | libcrypto \ |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 224 | libcutils \ |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 225 | libdiagnose_usb \ |
Felipe Leme | 042c351 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 226 | libgmock_host \ |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 227 | |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 228 | LOCAL_STATIC_LIBRARIES_linux := libusb |
| 229 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
| 230 | |
Spencer Low | 50740f5 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 231 | # Set entrypoint to wmain from sysdeps_win32.cpp instead of main |
| 232 | LOCAL_LDFLAGS_windows := -municode |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 233 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 234 | LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 235 | LOCAL_LDLIBS_windows := -lws2_32 -luserenv |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 236 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
Dan Albert | 4895c52 | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 237 | |
Dan Willemsen | c6aa5d6 | 2015-12-21 16:14:31 -0800 | [diff] [blame] | 238 | LOCAL_MULTILIB := first |
| 239 | |
Spencer Low | c9ddd81 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 240 | include $(BUILD_HOST_NATIVE_TEST) |
| 241 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 242 | # adb host tool |
| 243 | # ========================================================= |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 244 | include $(CLEAR_VARS) |
| 245 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 246 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 247 | |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 248 | 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] | 249 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 250 | # Use wmain instead of main |
| 251 | LOCAL_LDFLAGS_windows := -municode |
Josh Gao | 1cd5857 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 252 | LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 253 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
| 254 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi |
Dan Albert | 250e58c | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 255 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 256 | LOCAL_SRC_FILES := \ |
Elliott Hughes | f5cdc1d | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 257 | adb_client.cpp \ |
Felipe Leme | 042c351 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 258 | bugreport.cpp \ |
Dan Albert | 53a3744 | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 259 | client/main.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 260 | console.cpp \ |
| 261 | commandline.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 262 | file_sync_client.cpp \ |
Elliott Hughes | f5cdc1d | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 263 | line_printer.cpp \ |
| 264 | services.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 265 | shell_service_protocol.cpp \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 266 | |
Dan Albert | 50f9b90 | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 267 | LOCAL_CFLAGS += \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 268 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | 50f9b90 | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 269 | -D_GNU_SOURCE \ |
| 270 | -DADB_HOST=1 \ |
| 271 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 272 | LOCAL_CFLAGS_windows := \ |
| 273 | $(ADB_COMMON_windows_CFLAGS) |
| 274 | |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 275 | LOCAL_CFLAGS_linux := \ |
| 276 | $(ADB_COMMON_linux_CFLAGS) \ |
| 277 | |
| 278 | LOCAL_CFLAGS_darwin := \ |
| 279 | $(ADB_COMMON_darwin_CFLAGS) \ |
| 280 | -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \ |
| 281 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 282 | LOCAL_MODULE := adb |
Benoit Goby | 12dc369 | 2013-02-20 15:04:53 -0800 | [diff] [blame] | 283 | LOCAL_MODULE_TAGS := debug |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 284 | LOCAL_MODULE_HOST_OS := darwin linux windows |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 285 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 286 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 287 | LOCAL_STATIC_LIBRARIES := \ |
| 288 | libadb \ |
Elliott Hughes | 170b568 | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 289 | libbase \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 290 | libcrypto_utils \ |
| 291 | libcrypto \ |
Elliott Hughes | 7009749 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 292 | libdiagnose_usb \ |
Elliott Hughes | 949f262 | 2015-04-27 14:20:17 -0700 | [diff] [blame] | 293 | liblog \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 294 | |
Josh Gao | f5570b8 | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 295 | # Don't use libcutils on Windows. |
| 296 | LOCAL_STATIC_LIBRARIES_darwin := libcutils |
| 297 | LOCAL_STATIC_LIBRARIES_linux := libcutils |
| 298 | |
Josh Gao | b736692 | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 299 | LOCAL_STATIC_LIBRARIES_darwin += libusb |
| 300 | LOCAL_STATIC_LIBRARIES_linux += libusb |
| 301 | |
Dan Willemsen | 1cc079a | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 302 | LOCAL_CXX_STL := libc++_static |
Colin Cross | 0a34bfb | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 303 | |
| 304 | # Don't add anything here, we don't want additional shared dependencies |
| 305 | # on the host adb tool, and shared libraries that link against libc++ |
| 306 | # will violate ODR |
| 307 | LOCAL_SHARED_LIBRARIES := |
| 308 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 309 | include $(BUILD_HOST_EXECUTABLE) |
| 310 | |
Ying Wang | 458321a | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 311 | $(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE)) |
| 312 | ifdef HOST_CROSS_OS |
| 313 | # Archive adb.exe for win_sdk build. |
| 314 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT)) |
| 315 | endif |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 316 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 317 | |
| 318 | # adbd device daemon |
| 319 | # ========================================================= |
| 320 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 321 | include $(CLEAR_VARS) |
| 322 | |
Elliott Hughes | df5bb43 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 323 | LOCAL_CLANG := true |
Dan Albert | 250e58c | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 324 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 325 | LOCAL_SRC_FILES := \ |
Dan Albert | 53a3744 | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 326 | daemon/main.cpp \ |
Casey Dahlin | 10ad15f | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 327 | daemon/mdns.cpp \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 328 | services.cpp \ |
| 329 | file_sync_service.cpp \ |
| 330 | framebuffer_service.cpp \ |
| 331 | remount_service.cpp \ |
| 332 | set_verity_enable_state_service.cpp \ |
David Pursell | 4f344bb | 2015-08-28 15:08:49 -0700 | [diff] [blame] | 333 | shell_service.cpp \ |
David Pursell | d0df2dd | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 334 | shell_service_protocol.cpp \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 335 | |
Christopher Ferris | d930691 | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 336 | LOCAL_CFLAGS := \ |
Dan Albert | a8285fb | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 337 | $(ADB_COMMON_CFLAGS) \ |
Josh Gao | e3a87d0 | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 338 | $(ADB_COMMON_linux_CFLAGS) \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 339 | -DADB_HOST=0 \ |
| 340 | -D_GNU_SOURCE \ |
Dan Albert | f30d73c | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 341 | -Wno-deprecated-declarations \ |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 342 | |
Elliott Hughes | d7eb854 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 343 | 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] | 344 | |
Elliott Hughes | dedf767 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 345 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 346 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
Elliott Hughes | d7eb854 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 347 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 348 | endif |
| 349 | |
The Android Open Source Project | 9ca14dc | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 350 | LOCAL_MODULE := adbd |
| 351 | |
| 352 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 353 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 354 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 355 | |
Dan Albert | fd0be89 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 356 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Josh Gao | ab5449d | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 357 | LOCAL_STRIP_MODULE := keep_symbols |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 358 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | dfef94a | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 359 | libadbd \ |
Tao Bao | 0db6764 | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 360 | libbase \ |
Tao Bao | a8c21dc | 2017-01-05 18:01:01 -0800 | [diff] [blame] | 361 | libbootloader_message \ |
Dan Albert | 0ca996b | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 362 | libfs_mgr \ |
Sami Tolvanen | 778f500 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 363 | libfec \ |
| 364 | libfec_rs \ |
William Roberts | 075c852 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 365 | libselinux \ |
Dan Albert | bbbbea6 | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 366 | liblog \ |
Alex Deymo | f2c8699 | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 367 | libext4_utils \ |
Sami Tolvanen | 778f500 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 368 | libsquashfs_utils \ |
Dan Albert | 27929b0 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 369 | libcutils \ |
| 370 | libbase \ |
Josh Gao | efe6afa | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 371 | libcrypto_utils \ |
| 372 | libcrypto \ |
Josh Gao | ab5449d | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 373 | libminijail \ |
Casey Dahlin | 10ad15f | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 374 | libmdnssd \ |
Josh Gao | 690b0a9 | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 375 | libdebuggerd_handler \ |
Paul Lawrence | 5f35648 | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 376 | |
Jeff Brown | f5287b7 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 377 | include $(BUILD_EXECUTABLE) |
Josh Gao | 484aaba | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 378 | |
| 379 | include $(call first-makefiles-under,$(LOCAL_PATH)) |