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