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) |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 111 | LOCAL_MODULE := libadbd_usb |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 112 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 113 | LOCAL_SRC_FILES := daemon/usb.cpp |
Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 114 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 115 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 116 | |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 117 | # Even though we're building a static library (and thus there's no link step for |
| 118 | # this to take effect), this adds the includes to our path. |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 119 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 120 | |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 121 | include $(BUILD_STATIC_LIBRARY) |
| 122 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 123 | include $(CLEAR_VARS) |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 124 | LOCAL_MODULE := libadbd |
| 125 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
| 126 | LOCAL_SRC_FILES := \ |
| 127 | $(LIBADB_SRC_FILES) \ |
| 128 | adbd_auth.cpp \ |
| 129 | jdwp_service.cpp \ |
Josh Gao | 46de1d7 | 2017-04-12 13:57:06 -0700 | [diff] [blame] | 130 | sysdeps/posix/network.cpp \ |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 131 | |
| 132 | LOCAL_SANITIZE := $(adb_target_sanitize) |
| 133 | |
| 134 | # Even though we're building a static library (and thus there's no link step for |
| 135 | # this to take effect), this adds the includes to our path. |
| 136 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase |
| 137 | |
| 138 | LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb |
| 139 | |
| 140 | include $(BUILD_STATIC_LIBRARY) |
| 141 | |
| 142 | include $(CLEAR_VARS) |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 143 | LOCAL_MODULE := libadb |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 144 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 145 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 146 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 147 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 148 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 149 | LOCAL_SRC_FILES := \ |
| 150 | $(LIBADB_SRC_FILES) \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 151 | adb_auth_host.cpp \ |
| 152 | transport_mdns.cpp \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 153 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 154 | LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES) |
| 155 | LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES) |
| 156 | LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES) |
| 157 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 158 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 159 | |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 160 | # 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] | 161 | # this to take effect), this adds the includes to our path. |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 162 | LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd |
| 163 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 164 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 165 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 166 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/ |
Dan Willemsen | 66680c5 | 2015-09-03 20:29:56 -0700 | [diff] [blame] | 167 | LOCAL_MULTILIB := first |
Dan Albert | 88cf1c8 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 168 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 169 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 170 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 171 | include $(CLEAR_VARS) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 172 | LOCAL_MODULE := adbd_test |
| 173 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) |
Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 174 | LOCAL_SRC_FILES := \ |
| 175 | $(LIBADB_TEST_SRCS) \ |
| 176 | $(LIBADB_TEST_linux_SRCS) \ |
David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 177 | shell_service.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 178 | shell_service_protocol.cpp \ |
| 179 | shell_service_protocol_test.cpp \ |
David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 180 | shell_service_test.cpp \ |
Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 181 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 182 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 183 | LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd |
Dimitry Ivanov | 01f21da | 2016-02-12 18:40:29 -0800 | [diff] [blame] | 184 | LOCAL_SHARED_LIBRARIES := liblog libbase libcutils |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 185 | include $(BUILD_NATIVE_TEST) |
| 186 | |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 187 | # libdiagnose_usb |
| 188 | # ========================================================= |
| 189 | |
| 190 | include $(CLEAR_VARS) |
| 191 | LOCAL_MODULE := libdiagnose_usb |
| 192 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 193 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) |
| 194 | LOCAL_SRC_FILES := diagnose_usb.cpp |
| 195 | # Even though we're building a static library (and thus there's no link step for |
| 196 | # this to take effect), this adds the includes to our path. |
| 197 | LOCAL_STATIC_LIBRARIES := libbase |
| 198 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 199 | |
Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 200 | # adb_test |
| 201 | # ========================================================= |
| 202 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 203 | include $(CLEAR_VARS) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 204 | LOCAL_MODULE := adb_test |
Spencer Low | ebf770f | 2015-09-07 23:39:02 -0700 | [diff] [blame] | 205 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 206 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 207 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) |
| 208 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 209 | LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS) |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 210 | LOCAL_SRC_FILES := \ |
| 211 | $(LIBADB_TEST_SRCS) \ |
Felipe Leme | 698e065 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 212 | adb_client.cpp \ |
| 213 | bugreport.cpp \ |
| 214 | bugreport_test.cpp \ |
Felipe Leme | 6f5080f | 2016-07-26 12:23:40 -0700 | [diff] [blame] | 215 | line_printer.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 216 | services.cpp \ |
| 217 | shell_service_protocol.cpp \ |
| 218 | shell_service_protocol_test.cpp \ |
| 219 | |
David Pursell | b404dec | 2015-09-11 16:06:59 -0700 | [diff] [blame] | 220 | LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS) |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 221 | LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS) |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 222 | LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS) |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 223 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 224 | LOCAL_STATIC_LIBRARIES := \ |
| 225 | libadb \ |
Josh Gao | 47330e2 | 2017-04-12 17:04:41 -0700 | [diff] [blame] | 226 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 227 | libcrypto_utils \ |
| 228 | libcrypto \ |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 229 | libcutils \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 230 | libdiagnose_usb \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 231 | libmdnssd \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 232 | libgmock_host \ |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 233 | |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 234 | LOCAL_STATIC_LIBRARIES_linux := libusb |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 235 | LOCAL_STATIC_LIBRARIES_darwin := libusb |
| 236 | |
Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 237 | # Set entrypoint to wmain from sysdeps_win32.cpp instead of main |
| 238 | LOCAL_LDFLAGS_windows := -municode |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 239 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 240 | LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc |
Josh Gao | 3d4d973 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 241 | LOCAL_LDLIBS_windows := -lws2_32 -luserenv |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 242 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 243 | |
Dan Willemsen | 1e20e0a | 2015-12-21 16:14:31 -0800 | [diff] [blame] | 244 | LOCAL_MULTILIB := first |
| 245 | |
Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 246 | include $(BUILD_HOST_NATIVE_TEST) |
| 247 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 248 | # adb host tool |
| 249 | # ========================================================= |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 250 | include $(CLEAR_VARS) |
| 251 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 252 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 253 | |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 254 | 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] | 255 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 256 | # Use wmain instead of main |
| 257 | LOCAL_LDFLAGS_windows := -municode |
Josh Gao | 3d4d973 | 2017-02-23 13:16:52 -0800 | [diff] [blame] | 258 | LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 259 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
| 260 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 261 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 262 | LOCAL_SRC_FILES := \ |
Elliott Hughes | b708d16 | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 263 | adb_client.cpp \ |
Felipe Leme | 698e065 | 2016-07-19 17:07:22 -0700 | [diff] [blame] | 264 | bugreport.cpp \ |
Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 265 | client/main.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 266 | console.cpp \ |
| 267 | commandline.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 268 | file_sync_client.cpp \ |
Elliott Hughes | b708d16 | 2015-10-27 16:03:15 -0700 | [diff] [blame] | 269 | line_printer.cpp \ |
| 270 | services.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 271 | shell_service_protocol.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 272 | |
Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 273 | LOCAL_CFLAGS += \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 274 | $(ADB_COMMON_CFLAGS) \ |
Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 275 | -D_GNU_SOURCE \ |
| 276 | -DADB_HOST=1 \ |
| 277 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 278 | LOCAL_CFLAGS_windows := \ |
| 279 | $(ADB_COMMON_windows_CFLAGS) |
| 280 | |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 281 | LOCAL_CFLAGS_linux := \ |
| 282 | $(ADB_COMMON_linux_CFLAGS) \ |
| 283 | |
| 284 | LOCAL_CFLAGS_darwin := \ |
| 285 | $(ADB_COMMON_darwin_CFLAGS) \ |
| 286 | -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \ |
| 287 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 288 | LOCAL_MODULE := adb |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 289 | LOCAL_MODULE_TAGS := debug |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 290 | LOCAL_MODULE_HOST_OS := darwin linux windows |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 291 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 292 | LOCAL_SANITIZE := $(adb_host_sanitize) |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 293 | LOCAL_STATIC_LIBRARIES := \ |
| 294 | libadb \ |
Elliott Hughes | 2baae3a | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 295 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 296 | libcrypto_utils \ |
| 297 | libcrypto \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 298 | libdiagnose_usb \ |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 299 | liblog \ |
Elliott Hughes | 8964fbf | 2017-05-10 08:41:33 -0700 | [diff] [blame] | 300 | libmdnssd \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 301 | |
Josh Gao | a629e2e | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 302 | # Don't use libcutils on Windows. |
| 303 | LOCAL_STATIC_LIBRARIES_darwin := libcutils |
Casey Dahlin | 2fe9b60 | 2016-09-21 14:03:39 -0700 | [diff] [blame] | 304 | LOCAL_STATIC_LIBRARIES_linux := libcutils |
Josh Gao | a629e2e | 2015-11-13 17:55:45 -0800 | [diff] [blame] | 305 | |
Josh Gao | 1c70e1b | 2016-09-28 12:32:45 -0700 | [diff] [blame] | 306 | LOCAL_STATIC_LIBRARIES_darwin += libusb |
| 307 | LOCAL_STATIC_LIBRARIES_linux += libusb |
| 308 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 309 | LOCAL_CXX_STL := libc++_static |
Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 310 | |
| 311 | # Don't add anything here, we don't want additional shared dependencies |
| 312 | # on the host adb tool, and shared libraries that link against libc++ |
| 313 | # will violate ODR |
| 314 | LOCAL_SHARED_LIBRARIES := |
| 315 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 316 | include $(BUILD_HOST_EXECUTABLE) |
| 317 | |
Ying Wang | 71edfc8 | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 318 | $(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE)) |
| 319 | ifdef HOST_CROSS_OS |
| 320 | # Archive adb.exe for win_sdk build. |
| 321 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT)) |
| 322 | endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 323 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 324 | |
| 325 | # adbd device daemon |
| 326 | # ========================================================= |
| 327 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 328 | include $(CLEAR_VARS) |
| 329 | |
| 330 | LOCAL_SRC_FILES := \ |
Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 331 | daemon/main.cpp \ |
Casey Dahlin | 6cd5e0b | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 332 | daemon/mdns.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 333 | services.cpp \ |
| 334 | file_sync_service.cpp \ |
| 335 | framebuffer_service.cpp \ |
| 336 | remount_service.cpp \ |
| 337 | set_verity_enable_state_service.cpp \ |
David Pursell | 80f6702 | 2015-08-28 15:08:49 -0700 | [diff] [blame] | 338 | shell_service.cpp \ |
David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 339 | shell_service_protocol.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 340 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 341 | LOCAL_CFLAGS := \ |
Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 342 | $(ADB_COMMON_CFLAGS) \ |
Josh Gao | b7b1edf | 2015-11-11 17:56:12 -0800 | [diff] [blame] | 343 | $(ADB_COMMON_linux_CFLAGS) \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 344 | -DADB_HOST=0 \ |
| 345 | -D_GNU_SOURCE \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 346 | -Wno-deprecated-declarations \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 347 | |
Elliott Hughes | 5cba504 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 348 | 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] | 349 | |
Elliott Hughes | ec7a667 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 350 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 351 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
Bowgo Tsai | 0603ec4 | 2017-08-31 06:26:47 +0000 | [diff] [blame^] | 352 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 353 | endif |
| 354 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 355 | LOCAL_MODULE := adbd |
| 356 | |
| 357 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 358 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 359 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 360 | |
Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 361 | LOCAL_SANITIZE := $(adb_target_sanitize) |
Josh Gao | 809607a | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 362 | LOCAL_STRIP_MODULE := keep_symbols |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 363 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 364 | libadbd \ |
David Zeuthen | 1e033d6 | 2017-04-12 16:07:06 -0400 | [diff] [blame] | 365 | libavb_user \ |
Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 366 | libbase \ |
Tao Bao | 40e0ec9 | 2017-01-05 18:01:01 -0800 | [diff] [blame] | 367 | libbootloader_message \ |
Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 368 | libfs_mgr \ |
Sami Tolvanen | 8ad8076 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 369 | libfec \ |
| 370 | libfec_rs \ |
William Roberts | bd2d961 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 371 | libselinux \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 372 | liblog \ |
Alex Deymo | 705353a | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 373 | libext4_utils \ |
Sami Tolvanen | 8ad8076 | 2015-10-20 13:24:24 +0100 | [diff] [blame] | 374 | libsquashfs_utils \ |
Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 375 | libcutils \ |
| 376 | libbase \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 377 | libcrypto_utils \ |
| 378 | libcrypto \ |
Josh Gao | 809607a | 2016-06-15 18:33:11 -0700 | [diff] [blame] | 379 | libminijail \ |
Casey Dahlin | 6cd5e0b | 2016-05-06 16:19:13 -0700 | [diff] [blame] | 380 | libmdnssd \ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 381 | libdebuggerd_handler \ |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 382 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 383 | include $(BUILD_EXECUTABLE) |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 384 | |
GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 385 | # adb integration test |
| 386 | # ========================================================= |
| 387 | $(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_adb.BUILT)) |
| 388 | $(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_device.BUILT)) |
| 389 | |
Josh Gao | 44c688c | 2017-01-11 17:37:35 -0800 | [diff] [blame] | 390 | include $(call first-makefiles-under,$(LOCAL_PATH)) |