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 | |
Elliott Hughes | 4d4f64f | 2017-05-08 11:30:34 -0700 | [diff] [blame] | 8 | include $(LOCAL_PATH)/../platform_tools_tool_version.mk |
| 9 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 10 | adb_host_sanitize := |
| 11 | adb_target_sanitize := |
| 12 | |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 13 | ADB_COMMON_CFLAGS := \ |
Dan Albert | 23fee8f | 2015-05-20 18:56:10 -0700 | [diff] [blame] | 14 | -Wall -Wextra -Werror \ |
Dan Albert | 459df8f | 2015-07-08 13:50:42 -0700 | [diff] [blame] | 15 | -Wno-unused-parameter \ |
Dan Albert | 286bb6d | 2015-07-09 20:35:09 +0000 | [diff] [blame] | 16 | -Wno-missing-field-initializers \ |
Elliott Hughes | 6d92997 | 2015-10-27 13:40:35 -0700 | [diff] [blame] | 17 | -Wvla \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 18 | -DADB_VERSION="\"$(tool_version)\"" \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 19 | |
Josh Gao | 68f679c | 2017-05-03 14:01:35 -0700 | [diff] [blame] | 20 | ADB_COMMON_posix_CFLAGS := \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 21 | -Wexit-time-destructors \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 22 | -Wthread-safety \ |
Josh Gao | 68f679c | 2017-05-03 14:01:35 -0700 | [diff] [blame] | 23 | |
| 24 | ADB_COMMON_linux_CFLAGS := \ |
| 25 | $(ADB_COMMON_posix_CFLAGS) \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 26 | |
| 27 | ADB_COMMON_darwin_CFLAGS := \ |
Josh Gao | 68f679c | 2017-05-03 14:01:35 -0700 | [diff] [blame] | 28 | $(ADB_COMMON_posix_CFLAGS) \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 29 | |
Spencer Low | e347c1d | 2015-08-02 18:13:54 -0700 | [diff] [blame] | 30 | # Define windows.h and tchar.h Unicode preprocessor symbols so that |
| 31 | # CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the |
| 32 | # build if you accidentally pass char*. Fix by calling like: |
Spencer Low | d21dc82 | 2015-11-12 15:20:15 -0800 | [diff] [blame] | 33 | # std::wstring path_wide; |
| 34 | # if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ } |
| 35 | # CreateFileW(path_wide.c_str()); |
Spencer Low | e347c1d | 2015-08-02 18:13:54 -0700 | [diff] [blame] | 36 | ADB_COMMON_windows_CFLAGS := \ |
| 37 | -DUNICODE=1 -D_UNICODE=1 \ |
| 38 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 39 | # libadb |
| 40 | # ========================================================= |
| 41 | |
| 42 | # Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes |
| 43 | # made to adb rarely get ported to the other two, so the trees have diverged a |
| 44 | # bit. We'd like to stop this because it is a maintenance nightmare, but the |
| 45 | # divergence makes this difficult to do all at once. For now, we will start |
| 46 | # small by moving common files into a static library. Hopefully some day we can |
| 47 | # get enough of adb in here that we no longer need minadb. https://b/17626262 |
Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 48 | LIBADB_SRC_FILES := \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 49 | adb.cpp \ |
Dan Albert | cc731cc | 2015-02-24 21:26:58 -0800 | [diff] [blame] | 50 | adb_io.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 51 | adb_listeners.cpp \ |
Yabin Cui | aed3c61 | 2015-09-22 15:52:57 -0700 | [diff] [blame] | 52 | adb_trace.cpp \ |
Elliott Hughes | 5830577 | 2015-04-17 13:57:15 -0700 | [diff] [blame] | 53 | adb_utils.cpp \ |
Josh Gao | 3777d2e | 2016-02-16 17:34:53 -0800 | [diff] [blame] | 54 | fdevent.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 55 | sockets.cpp \ |
Josh Gao | cfb2141 | 2016-08-24 18:38:44 -0700 | [diff] [blame] | 56 | socket_spec.cpp \ |
Josh Gao | 5a1e3fd | 2016-12-05 17:11:34 -0800 | [diff] [blame] | 57 | sysdeps/errno.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 58 | transport.cpp \ |
| 59 | transport_local.cpp \ |
| 60 | transport_usb.cpp \ |
Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 61 | |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 62 | LIBADB_TEST_SRCS := \ |
| 63 | adb_io_test.cpp \ |
David Pursell | eaae97e | 2016-04-07 11:25:48 -0700 | [diff] [blame] | 64 | adb_listeners_test.cpp \ |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 65 | adb_utils_test.cpp \ |
Josh Gao | 022d447 | 2016-02-10 14:49:00 -0800 | [diff] [blame] | 66 | fdevent_test.cpp \ |
Josh Gao | 1099215 | 2016-09-19 17:31:55 -0700 | [diff] [blame] | 67 | socket_spec_test.cpp \ |
Josh Gao | 022d447 | 2016-02-10 14:49:00 -0800 | [diff] [blame] | 68 | socket_test.cpp \ |
Josh Gao | 3b3e10d | 2016-02-09 14:59:09 -0800 | [diff] [blame] | 69 | sysdeps_test.cpp \ |
Josh Gao | f551ea0 | 2016-07-28 18:09:48 -0700 | [diff] [blame] | 70 | sysdeps/stat_test.cpp \ |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 71 | transport_test.cpp \ |
| 72 | |
Dan Albert | bf10647 | 2015-02-20 17:20:09 -0800 | [diff] [blame] | 73 | LIBADB_CFLAGS := \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 74 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 75 | -fvisibility=hidden \ |
Elliott Hughes | 4f1d7b5 | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 76 | |
| 77 | LIBADB_linux_CFLAGS := \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 78 | $(ADB_COMMON_linux_CFLAGS) \ |
| 79 | |
| 80 | LIBADB_darwin_CFLAGS := \ |
| 81 | $(ADB_COMMON_darwin_CFLAGS) \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 82 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 83 | LIBADB_windows_CFLAGS := \ |
| 84 | $(ADB_COMMON_windows_CFLAGS) \ |
Elliott Hughes | 4f1d7b5 | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 85 | |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 86 | LIBADB_darwin_SRC_FILES := \ |
David Pursell | bfd9503 | 2016-02-22 14:27:23 -0800 | [diff] [blame] | 87 | sysdeps_unix.cpp \ |
Josh Gao | 46de1d7 | 2017-04-12 13:57:06 -0700 | [diff] [blame] | 88 | sysdeps/posix/network.cpp \ |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 89 | client/usb_dispatch.cpp \ |
| 90 | client/usb_libusb.cpp \ |
Josh Gao | 456e1ad | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 91 | client/usb_osx.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 92 | |
| 93 | LIBADB_linux_SRC_FILES := \ |
David Pursell | bfd9503 | 2016-02-22 14:27:23 -0800 | [diff] [blame] | 94 | sysdeps_unix.cpp \ |
Josh Gao | 46de1d7 | 2017-04-12 13:57:06 -0700 | [diff] [blame] | 95 | sysdeps/posix/network.cpp \ |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 96 | client/usb_dispatch.cpp \ |
| 97 | client/usb_libusb.cpp \ |
Josh Gao | 456e1ad | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 98 | client/usb_linux.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 99 | |
| 100 | LIBADB_windows_SRC_FILES := \ |
Elliott Hughes | a2f2e56 | 2015-04-16 16:47:02 -0700 | [diff] [blame] | 101 | sysdeps_win32.cpp \ |
Josh Gao | a3577e1 | 2016-12-05 13:24:48 -0800 | [diff] [blame] | 102 | sysdeps/win32/errno.cpp \ |
Josh Gao | f551ea0 | 2016-07-28 18:09:48 -0700 | [diff] [blame] | 103 | sysdeps/win32/stat.cpp \ |
Josh Gao | 456e1ad | 2017-01-19 13:44:23 -0800 | [diff] [blame] | 104 | client/usb_windows.cpp \ |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 105 | |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 106 | LIBADB_TEST_windows_SRCS := \ |
Josh Gao | a3577e1 | 2016-12-05 13:24:48 -0800 | [diff] [blame] | 107 | sysdeps/win32/errno_test.cpp \ |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 108 | sysdeps_win32_test.cpp \ |
| 109 | |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 110 | include $(CLEAR_VARS) |
Elliott Hughes | 2acec91 | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 111 | LOCAL_CLANG := true |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 112 | LOCAL_MODULE := libadbd_usb |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 113 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 114 | LOCAL_SRC_FILES := daemon/usb.cpp |
Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 115 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 116 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 117 | |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 118 | # Even though we're building a static library (and thus there's no link step for |
| 119 | # this to take effect), this adds the includes to our path. |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 120 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 121 | |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 122 | include $(BUILD_STATIC_LIBRARY) |
| 123 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 124 | include $(CLEAR_VARS) |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 125 | LOCAL_CLANG := true |
| 126 | LOCAL_MODULE := libadbd |
| 127 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
| 128 | LOCAL_SRC_FILES := \ |
| 129 | $(LIBADB_SRC_FILES) \ |
| 130 | adbd_auth.cpp \ |
| 131 | jdwp_service.cpp \ |
Josh Gao | 46de1d7 | 2017-04-12 13:57:06 -0700 | [diff] [blame] | 132 | sysdeps/posix/network.cpp \ |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 133 | |
| 134 | LOCAL_SANITIZE := $(adb_target_sanitize) |
| 135 | |
| 136 | # Even though we're building a static library (and thus there's no link step for |
| 137 | # this to take effect), this adds the includes to our path. |
| 138 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
| 139 | |
| 140 | LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb |
| 141 | |
| 142 | include $(BUILD_STATIC_LIBRARY) |
| 143 | |
| 144 | include $(CLEAR_VARS) |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 145 | LOCAL_MODULE := libadb |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 146 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 147 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 148 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 149 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 150 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 151 | LOCAL_SRC_FILES := \ |
| 152 | $(LIBADB_SRC_FILES) \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 153 | adb_auth_host.cpp \ |
| 154 | transport_mdns.cpp \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 155 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 156 | LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES) |
| 157 | LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES) |
| 158 | LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES) |
| 159 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 160 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 161 | |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 162 | # Even though we're building a static library (and thus there's no link step for |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 163 | # this to take effect), this adds the includes to our path. |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 164 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd |
| 165 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 166 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 167 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 168 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/ |
Dan Willemsen | 66680c5 | 2015-09-03 20:29:56 -0700 | [diff] [blame] | 169 | LOCAL_MULTILIB := first |
Dan Albert | 88cf1c8 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 170 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 171 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 172 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 173 | include $(CLEAR_VARS) |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 174 | LOCAL_CLANG := true |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 175 | LOCAL_MODULE := adbd_test |
| 176 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) |
Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 177 | LOCAL_SRC_FILES := \ |
| 178 | $(LIBADB_TEST_SRCS) \ |
| 179 | $(LIBADB_TEST_linux_SRCS) \ |
David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 180 | shell_service.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 181 | shell_service_protocol.cpp \ |
| 182 | shell_service_protocol_test.cpp \ |
David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 183 | shell_service_test.cpp \ |
Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 184 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 185 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 186 | LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd |
Dimitry Ivanov | 01f21da | 2016-02-12 18:40:29 -0800 | [diff] [blame] | 187 | LOCAL_SHARED_LIBRARIES := liblog libbase libcutils |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 188 | include $(BUILD_NATIVE_TEST) |
| 189 | |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 190 | # libdiagnose_usb |
| 191 | # ========================================================= |
| 192 | |
| 193 | include $(CLEAR_VARS) |
| 194 | LOCAL_MODULE := libdiagnose_usb |
| 195 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 196 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) |
| 197 | LOCAL_SRC_FILES := diagnose_usb.cpp |
| 198 | # Even though we're building a static library (and thus there's no link step for |
| 199 | # this to take effect), this adds the includes to our path. |
| 200 | LOCAL_STATIC_LIBRARIES := libbase |
| 201 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 202 | |
Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 203 | # adb_test |
| 204 | # ========================================================= |
| 205 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 206 | include $(CLEAR_VARS) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 207 | LOCAL_MODULE := adb_test |
Spencer Low | ebf770f | 2015-09-07 23:39:02 -0700 | [diff] [blame] | 208 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 209 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 210 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 211 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 212 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 213 | LOCAL_SRC_FILES := \ |
| 214 | $(LIBADB_TEST_SRCS) \ |
Felipe Leme | 698e065 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 215 | adb_client.cpp \ |
| 216 | bugreport.cpp \ |
| 217 | bugreport_test.cpp \ |
Felipe Leme | 6f5080f | 2016-07-26 12:23:40 -0700 | [diff] [blame] | 218 | line_printer.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 219 | services.cpp \ |
| 220 | shell_service_protocol.cpp \ |
| 221 | shell_service_protocol_test.cpp \ |
| 222 | |
David Pursell | b404dec | 2015-09-11 16:06:59 -0700 | [diff] [blame] | 223 | LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 224 | LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS) |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 225 | LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS) |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 226 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 227 | LOCAL_STATIC_LIBRARIES := \ |
| 228 | libadb \ |
Josh Gao | 47330e2 | 2017-04-12 17:04:41 -0700 | [diff] [blame] | 229 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 230 | libcrypto_utils \ |
| 231 | libcrypto \ |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 232 | libcutils \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 233 | libdiagnose_usb \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 234 | libmdnssd \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 235 | libgmock_host \ |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 236 | |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 237 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 238 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
| 239 | |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 240 | # Set entrypoint to wmain from sysdeps_win32.cpp instead of main |
| 241 | LOCAL_LDFLAGS_windows := -municode |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 242 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 243 | LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc |
Josh Gao | 3d4d973 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 244 | LOCAL_LDLIBS_windows := -lws2_32 -luserenv |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 245 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 246 | |
Dan Willemsen | 1e20e0a | 2015-12-21 16:14:31 -0800 | [diff] [blame] | 247 | LOCAL_MULTILIB := first |
| 248 | |
Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 249 | include $(BUILD_HOST_NATIVE_TEST) |
| 250 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 251 | # adb host tool |
| 252 | # ========================================================= |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 253 | include $(CLEAR_VARS) |
| 254 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 255 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 256 | |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 257 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon -lobjc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 258 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 259 | # Use wmain instead of main |
| 260 | LOCAL_LDFLAGS_windows := -municode |
Josh Gao | 3d4d973 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 261 | LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 262 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
| 263 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 264 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 265 | LOCAL_SRC_FILES := \ |
Elliott Hughes | b708d16 | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 266 | adb_client.cpp \ |
Felipe Leme | 698e065 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 267 | bugreport.cpp \ |
Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 268 | client/main.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 269 | console.cpp \ |
| 270 | commandline.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 271 | file_sync_client.cpp \ |
Elliott Hughes | b708d16 | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 272 | line_printer.cpp \ |
| 273 | services.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 274 | shell_service_protocol.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 275 | |
Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 276 | LOCAL_CFLAGS += \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 277 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 278 | -D_GNU_SOURCE \ |
| 279 | -DADB_HOST=1 \ |
| 280 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 281 | LOCAL_CFLAGS_windows := \ |
| 282 | $(ADB_COMMON_windows_CFLAGS) |
| 283 | |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 284 | LOCAL_CFLAGS_linux := \ |
| 285 | $(ADB_COMMON_linux_CFLAGS) \ |
| 286 | |
| 287 | LOCAL_CFLAGS_darwin := \ |
| 288 | $(ADB_COMMON_darwin_CFLAGS) \ |
| 289 | -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \ |
| 290 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 291 | LOCAL_MODULE := adb |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 292 | LOCAL_MODULE_TAGS := debug |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 293 | LOCAL_MODULE_HOST_OS := darwin linux windows |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 294 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 295 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 296 | LOCAL_STATIC_LIBRARIES := \ |
| 297 | libadb \ |
Elliott Hughes | 2baae3a | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 298 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 299 | libcrypto_utils \ |
| 300 | libcrypto \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 301 | libdiagnose_usb \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 302 | liblog \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 303 | libmdnssd \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 304 | |
Josh Gao | a629e2e | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 305 | # Don't use libcutils on Windows. |
| 306 | LOCAL_STATIC_LIBRARIES_darwin := libcutils |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 307 | LOCAL_STATIC_LIBRARIES_linux := libcutils |
Josh Gao | a629e2e | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 308 | |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 309 | LOCAL_STATIC_LIBRARIES_darwin += libusb |
| 310 | LOCAL_STATIC_LIBRARIES_linux += libusb |
| 311 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 312 | LOCAL_CXX_STL := libc++_static |
Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 313 | |
| 314 | # Don't add anything here, we don't want additional shared dependencies |
| 315 | # on the host adb tool, and shared libraries that link against libc++ |
| 316 | # will violate ODR |
| 317 | LOCAL_SHARED_LIBRARIES := |
| 318 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 319 | include $(BUILD_HOST_EXECUTABLE) |
| 320 | |
Ying Wang | 71edfc8 | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 321 | $(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE)) |
| 322 | ifdef HOST_CROSS_OS |
| 323 | # Archive adb.exe for win_sdk build. |
| 324 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT)) |
| 325 | endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 326 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 327 | |
| 328 | # adbd device daemon |
| 329 | # ========================================================= |
| 330 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 331 | include $(CLEAR_VARS) |
| 332 | |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 333 | LOCAL_CLANG := true |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 334 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 335 | LOCAL_SRC_FILES := \ |
Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 336 | daemon/main.cpp \ |
Casey Dahlin | 6cd5e0b | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 337 | daemon/mdns.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 338 | services.cpp \ |
| 339 | file_sync_service.cpp \ |
| 340 | framebuffer_service.cpp \ |
| 341 | remount_service.cpp \ |
| 342 | set_verity_enable_state_service.cpp \ |
David Pursell | 80f6702 | 2015-08-28 15:08:49 -0700 | [diff] [blame] | 343 | shell_service.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 344 | shell_service_protocol.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 345 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 346 | LOCAL_CFLAGS := \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 347 | $(ADB_COMMON_CFLAGS) \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 348 | $(ADB_COMMON_linux_CFLAGS) \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 349 | -DADB_HOST=0 \ |
| 350 | -D_GNU_SOURCE \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 351 | -Wno-deprecated-declarations \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 352 | |
Bowgo Tsai | f1d3dbc | 2017-07-11 21:47:54 +0800 | [diff] [blame] | 353 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0) |
Elliott Hughes | 5cba504 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 354 | LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0) |
Nick Kralevich | 5890fe3 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 355 | |
Elliott Hughes | ec7a667 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 356 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 357 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
| 358 | endif |
| 359 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 360 | LOCAL_MODULE := adbd |
| 361 | |
| 362 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 363 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 364 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 365 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 366 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Josh Gao | 809607a | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 367 | LOCAL_STRIP_MODULE := keep_symbols |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 368 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 369 | libadbd \ |
David Zeuthen | 1e033d6 | 2017-04-12 16:07:06 -0400 | [diff] [blame] | 370 | libavb_user \ |
Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 371 | libbase \ |
Tao Bao | 40e0ec9 | 2017-01-05 18:01:01 -0800 | [diff] [blame] | 372 | libbootloader_message \ |
Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 373 | libfs_mgr \ |
Sami Tolvanen | 8ad8076 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 374 | libfec \ |
| 375 | libfec_rs \ |
William Roberts | bd2d961 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 376 | libselinux \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 377 | liblog \ |
Alex Deymo | 705353a | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 378 | libext4_utils \ |
Sami Tolvanen | 8ad8076 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 379 | libsquashfs_utils \ |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 380 | libcutils \ |
| 381 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 382 | libcrypto_utils \ |
| 383 | libcrypto \ |
Josh Gao | 809607a | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 384 | libminijail \ |
Casey Dahlin | 6cd5e0b | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 385 | libmdnssd \ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 386 | libdebuggerd_handler \ |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 387 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 388 | include $(BUILD_EXECUTABLE) |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 389 | |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 390 | # adb integration test |
| 391 | # ========================================================= |
| 392 | $(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_adb.BUILT)) |
| 393 | $(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_device.BUILT)) |
| 394 | |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 395 | include $(call first-makefiles-under,$(LOCAL_PATH)) |