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