| 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 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 8 | adb_host_sanitize := | 
|  | 9 | adb_target_sanitize := | 
|  | 10 |  | 
| Dan Albert | 1ba1d7c | 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 | 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 \ | 
| Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 17 | -DADB_REVISION='"$(adb_version)"' \ | 
|  | 18 |  | 
| Spencer Low | e347c1d | 2015-08-02 18:13:54 -0700 | [diff] [blame] | 19 | # Define windows.h and tchar.h Unicode preprocessor symbols so that | 
|  | 20 | # CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the | 
|  | 21 | # build if you accidentally pass char*. Fix by calling like: | 
|  | 22 | # CreateFileW(widen(utf8).c_str()). | 
|  | 23 | ADB_COMMON_windows_CFLAGS := \ | 
|  | 24 | -DUNICODE=1 -D_UNICODE=1 \ | 
|  | 25 |  | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 26 | # libadb | 
|  | 27 | # ========================================================= | 
|  | 28 |  | 
|  | 29 | # Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes | 
|  | 30 | # made to adb rarely get ported to the other two, so the trees have diverged a | 
|  | 31 | # bit. We'd like to stop this because it is a maintenance nightmare, but the | 
|  | 32 | # divergence makes this difficult to do all at once. For now, we will start | 
|  | 33 | # small by moving common files into a static library. Hopefully some day we can | 
|  | 34 | # 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] | 35 | LIBADB_SRC_FILES := \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 36 | adb.cpp \ | 
|  | 37 | adb_auth.cpp \ | 
| Dan Albert | cc731cc | 2015-02-24 21:26:58 -0800 | [diff] [blame] | 38 | adb_io.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 39 | adb_listeners.cpp \ | 
| Elliott Hughes | 5830577 | 2015-04-17 13:57:15 -0700 | [diff] [blame] | 40 | adb_utils.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 41 | sockets.cpp \ | 
|  | 42 | transport.cpp \ | 
|  | 43 | transport_local.cpp \ | 
|  | 44 | transport_usb.cpp \ | 
| Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 45 |  | 
| Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 46 | LIBADB_TEST_SRCS := \ | 
|  | 47 | adb_io_test.cpp \ | 
|  | 48 | adb_utils_test.cpp \ | 
|  | 49 | transport_test.cpp \ | 
|  | 50 |  | 
| Dan Albert | bf10647 | 2015-02-20 17:20:09 -0800 | [diff] [blame] | 51 | LIBADB_CFLAGS := \ | 
| Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 52 | $(ADB_COMMON_CFLAGS) \ | 
| Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 53 | -fvisibility=hidden \ | 
| Elliott Hughes | 4f1d7b5 | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 54 |  | 
|  | 55 | LIBADB_linux_CFLAGS := \ | 
| Elliott Hughes | 812f030 | 2015-07-23 15:20:09 -0700 | [diff] [blame] | 56 | -std=c++14 \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 57 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 58 | LIBADB_windows_CFLAGS := \ | 
|  | 59 | $(ADB_COMMON_windows_CFLAGS) \ | 
| Elliott Hughes | 4f1d7b5 | 2015-07-24 14:32:46 -0700 | [diff] [blame] | 60 |  | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 61 | LIBADB_darwin_SRC_FILES := \ | 
|  | 62 | fdevent.cpp \ | 
| Elliott Hughes | 1a4d85a | 2015-04-16 13:24:58 -0700 | [diff] [blame] | 63 | get_my_path_darwin.cpp \ | 
| Dan Albert | 7447dd0 | 2015-04-16 19:20:40 -0700 | [diff] [blame] | 64 | usb_osx.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 65 |  | 
|  | 66 | LIBADB_linux_SRC_FILES := \ | 
|  | 67 | fdevent.cpp \ | 
|  | 68 | get_my_path_linux.cpp \ | 
|  | 69 | usb_linux.cpp \ | 
|  | 70 |  | 
|  | 71 | LIBADB_windows_SRC_FILES := \ | 
| Elliott Hughes | a2f2e56 | 2015-04-16 16:47:02 -0700 | [diff] [blame] | 72 | sysdeps_win32.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 73 | usb_windows.cpp \ | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 74 |  | 
| Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 75 | LIBADB_TEST_linux_SRCS := \ | 
|  | 76 | fdevent_test.cpp \ | 
|  | 77 |  | 
|  | 78 | LIBADB_TEST_darwin_SRCS := \ | 
|  | 79 | fdevent_test.cpp \ | 
|  | 80 |  | 
| Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 81 | LIBADB_TEST_windows_SRCS := \ | 
|  | 82 | sysdeps_win32_test.cpp \ | 
|  | 83 |  | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 84 | include $(CLEAR_VARS) | 
| Elliott Hughes | 2acec91 | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 85 | LOCAL_CLANG := true | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 86 | LOCAL_MODULE := libadbd | 
|  | 87 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 | 
| Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 88 | LOCAL_SRC_FILES := \ | 
|  | 89 | $(LIBADB_SRC_FILES) \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 90 | adb_auth_client.cpp \ | 
| Dan Albert | 3c43858 | 2015-02-20 17:24:30 -0800 | [diff] [blame] | 91 | fdevent.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 92 | jdwp_service.cpp \ | 
| Elliott Hughes | 2acec91 | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 93 | usb_linux_client.cpp \ | 
| Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 94 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 95 | LOCAL_SANITIZE := $(adb_target_sanitize) | 
| Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 96 |  | 
| Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 97 | # Even though we're building a static library (and thus there's no link step for | 
|  | 98 | # this to take effect), this adds the includes to our path. | 
|  | 99 | LOCAL_STATIC_LIBRARIES := libbase | 
|  | 100 |  | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 101 | include $(BUILD_STATIC_LIBRARY) | 
|  | 102 |  | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 103 | include $(CLEAR_VARS) | 
|  | 104 | LOCAL_MODULE := libadb | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 105 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 106 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 107 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) | 
|  | 108 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) | 
| Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 109 | LOCAL_SRC_FILES := \ | 
|  | 110 | $(LIBADB_SRC_FILES) \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 111 | adb_auth_host.cpp \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 112 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 113 | LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES) | 
|  | 114 | LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES) | 
|  | 115 | LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES) | 
|  | 116 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 117 | LOCAL_SANITIZE := $(adb_host_sanitize) | 
| Elliott Hughes | 7b50609 | 2015-04-20 08:09:20 -0700 | [diff] [blame] | 118 |  | 
| Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 119 | # 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] | 120 | # this to take effect), this adds the includes to our path. | 
|  | 121 | LOCAL_STATIC_LIBRARIES := libcrypto_static libbase | 
| Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 122 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 123 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/ | 
| Dan Willemsen | 66680c5 | 2015-09-03 20:29:56 -0700 | [diff] [blame] | 124 | LOCAL_MULTILIB := first | 
| Dan Albert | 88cf1c8 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 125 |  | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 126 | include $(BUILD_HOST_STATIC_LIBRARY) | 
|  | 127 |  | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 128 | include $(CLEAR_VARS) | 
| Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 129 | LOCAL_CLANG := true | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 130 | LOCAL_MODULE := adbd_test | 
|  | 131 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) | 
| Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 132 | LOCAL_SRC_FILES := \ | 
|  | 133 | $(LIBADB_TEST_SRCS) \ | 
|  | 134 | $(LIBADB_TEST_linux_SRCS) \ | 
| David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 135 | shell_service.cpp \ | 
| David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 136 | shell_service_protocol.cpp \ | 
|  | 137 | shell_service_protocol_test.cpp \ | 
| David Pursell | 0955c66 | 2015-08-31 10:42:13 -0700 | [diff] [blame] | 138 | shell_service_test.cpp \ | 
| Yabin Cui | bec02fc | 2015-08-28 15:44:27 -0700 | [diff] [blame] | 139 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 140 | LOCAL_SANITIZE := $(adb_target_sanitize) | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 141 | LOCAL_STATIC_LIBRARIES := libadbd | 
| Yabin Cui | cb992d9 | 2015-09-08 18:27:10 -0700 | [diff] [blame] | 142 | LOCAL_SHARED_LIBRARIES := libbase libcutils | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 143 | include $(BUILD_NATIVE_TEST) | 
|  | 144 |  | 
| Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 145 | # adb_test | 
|  | 146 | # ========================================================= | 
|  | 147 |  | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 148 | include $(CLEAR_VARS) | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 149 | LOCAL_MODULE := adb_test | 
| Spencer Low | ebf770f | 2015-09-07 23:39:02 -0700 | [diff] [blame] | 150 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 151 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 152 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) | 
|  | 153 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) | 
| David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 154 | LOCAL_SRC_FILES := \ | 
|  | 155 | $(LIBADB_TEST_SRCS) \ | 
|  | 156 | services.cpp \ | 
|  | 157 | shell_service_protocol.cpp \ | 
|  | 158 | shell_service_protocol_test.cpp \ | 
|  | 159 |  | 
| David Pursell | b404dec | 2015-09-11 16:06:59 -0700 | [diff] [blame] | 160 | LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS) | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 161 | LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS) | 
| Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 162 | LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS) | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 163 | LOCAL_SANITIZE := $(adb_host_sanitize) | 
| Yabin Cui | cb992d9 | 2015-09-08 18:27:10 -0700 | [diff] [blame] | 164 | LOCAL_SHARED_LIBRARIES := libbase | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 165 | LOCAL_STATIC_LIBRARIES := \ | 
|  | 166 | libadb \ | 
|  | 167 | libcrypto_static \ | 
|  | 168 | libcutils \ | 
|  | 169 |  | 
| Spencer Low | e6ae573 | 2015-09-08 17:13:04 -0700 | [diff] [blame] | 170 | # Set entrypoint to wmain from sysdeps_win32.cpp instead of main | 
|  | 171 | LOCAL_LDFLAGS_windows := -municode | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 172 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread | 
|  | 173 | LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit | 
|  | 174 | LOCAL_LDLIBS_windows := -lws2_32 -luserenv | 
|  | 175 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi | 
| Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 176 |  | 
| Spencer Low | cf168a8 | 2015-05-24 15:36:28 -0700 | [diff] [blame] | 177 | include $(BUILD_HOST_NATIVE_TEST) | 
|  | 178 |  | 
| Elliott Hughes | e67f1f8 | 2015-04-30 17:32:03 -0700 | [diff] [blame] | 179 | # adb device tracker (used by ddms) test tool | 
|  | 180 | # ========================================================= | 
|  | 181 |  | 
|  | 182 | ifeq ($(HOST_OS),linux) | 
|  | 183 | include $(CLEAR_VARS) | 
| Elliott Hughes | e67f1f8 | 2015-04-30 17:32:03 -0700 | [diff] [blame] | 184 | LOCAL_MODULE := adb_device_tracker_test | 
|  | 185 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 186 | LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS) | 
|  | 187 | LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS) | 
| Elliott Hughes | e67f1f8 | 2015-04-30 17:32:03 -0700 | [diff] [blame] | 188 | LOCAL_SRC_FILES := test_track_devices.cpp | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 189 | LOCAL_SANITIZE := $(adb_host_sanitize) | 
| Yabin Cui | cb992d9 | 2015-09-08 18:27:10 -0700 | [diff] [blame] | 190 | LOCAL_SHARED_LIBRARIES := libbase | 
| Elliott Hughes | e67f1f8 | 2015-04-30 17:32:03 -0700 | [diff] [blame] | 191 | LOCAL_STATIC_LIBRARIES := libadb libcrypto_static libcutils | 
|  | 192 | LOCAL_LDLIBS += -lrt -ldl -lpthread | 
|  | 193 | include $(BUILD_HOST_EXECUTABLE) | 
|  | 194 | endif | 
|  | 195 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 196 | # adb host tool | 
|  | 197 | # ========================================================= | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 198 | include $(CLEAR_VARS) | 
|  | 199 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 200 | LOCAL_LDLIBS_linux := -lrt -ldl -lpthread | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 201 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 202 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon | 
|  | 203 | LOCAL_CFLAGS_darwin := -Wno-sizeof-pointer-memaccess -Wno-unused-parameter | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 204 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 205 | # Use wmain instead of main | 
|  | 206 | LOCAL_LDFLAGS_windows := -municode | 
|  | 207 | LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 | 
|  | 208 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi | 
|  | 209 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi | 
| Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 210 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 211 | LOCAL_SRC_FILES := \ | 
| Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 212 | client/main.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 213 | console.cpp \ | 
|  | 214 | commandline.cpp \ | 
|  | 215 | adb_client.cpp \ | 
|  | 216 | services.cpp \ | 
|  | 217 | file_sync_client.cpp \ | 
| David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 218 | shell_service_protocol.cpp \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 219 |  | 
| Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 220 | LOCAL_CFLAGS += \ | 
| Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 221 | $(ADB_COMMON_CFLAGS) \ | 
| Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 222 | -D_GNU_SOURCE \ | 
|  | 223 | -DADB_HOST=1 \ | 
|  | 224 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 225 | LOCAL_CFLAGS_windows := \ | 
|  | 226 | $(ADB_COMMON_windows_CFLAGS) | 
|  | 227 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 228 | LOCAL_MODULE := adb | 
| Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 229 | LOCAL_MODULE_TAGS := debug | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 230 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 231 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 232 | LOCAL_SANITIZE := $(adb_host_sanitize) | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 233 | LOCAL_STATIC_LIBRARIES := \ | 
|  | 234 | libadb \ | 
| Elliott Hughes | 2baae3a | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 235 | libbase \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 236 | libcrypto_static \ | 
| Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 237 | libcutils \ | 
| Elliott Hughes | 9309ecb | 2015-04-27 14:20:17 -0700 | [diff] [blame] | 238 | liblog \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 239 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 240 | LOCAL_CXX_STL := libc++_static | 
| Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 241 |  | 
|  | 242 | # Don't add anything here, we don't want additional shared dependencies | 
|  | 243 | # on the host adb tool, and shared libraries that link against libc++ | 
|  | 244 | # will violate ODR | 
|  | 245 | LOCAL_SHARED_LIBRARIES := | 
|  | 246 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 247 | include $(BUILD_HOST_EXECUTABLE) | 
|  | 248 |  | 
| Ying Wang | 96535ba | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 249 | $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 250 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 251 |  | 
|  | 252 | # adbd device daemon | 
|  | 253 | # ========================================================= | 
|  | 254 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 255 | include $(CLEAR_VARS) | 
|  | 256 |  | 
| Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame] | 257 | LOCAL_CLANG := true | 
| Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 258 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 259 | LOCAL_SRC_FILES := \ | 
| Dan Albert | c89e0cc | 2015-05-08 16:13:53 -0700 | [diff] [blame] | 260 | daemon/main.cpp \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 261 | services.cpp \ | 
|  | 262 | file_sync_service.cpp \ | 
|  | 263 | framebuffer_service.cpp \ | 
|  | 264 | remount_service.cpp \ | 
|  | 265 | set_verity_enable_state_service.cpp \ | 
| David Pursell | 80f6702 | 2015-08-28 15:08:49 -0700 | [diff] [blame] | 266 | shell_service.cpp \ | 
| David Pursell | b9e2e84 | 2015-08-31 15:36:18 -0700 | [diff] [blame] | 267 | shell_service_protocol.cpp \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 268 |  | 
| Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 269 | LOCAL_CFLAGS := \ | 
| Dan Albert | 1ba1d7c | 2015-05-05 17:46:50 -0700 | [diff] [blame] | 270 | $(ADB_COMMON_CFLAGS) \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 271 | -DADB_HOST=0 \ | 
|  | 272 | -D_GNU_SOURCE \ | 
| Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 273 | -Wno-deprecated-declarations \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 274 |  | 
| Elliott Hughes | 5cba504 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 275 | 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] | 276 |  | 
| Elliott Hughes | ec7a667 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 277 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) | 
| Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 278 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 | 
| Elliott Hughes | 5cba504 | 2015-06-17 15:23:42 -0700 | [diff] [blame] | 279 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 | 
| Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 280 | endif | 
|  | 281 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 282 | LOCAL_MODULE := adbd | 
|  | 283 |  | 
|  | 284 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 
|  | 285 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) | 
|  | 286 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) | 
| Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 287 | LOCAL_C_INCLUDES += system/extras/ext4_utils | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 288 |  | 
| Dan Albert | 9113b47 | 2015-07-30 10:25:32 -0700 | [diff] [blame] | 289 | LOCAL_SANITIZE := $(adb_target_sanitize) | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 290 | LOCAL_STATIC_LIBRARIES := \ | 
| Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 291 | libadbd \ | 
| Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 292 | libbase \ | 
| Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 293 | libfs_mgr \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 294 | liblog \ | 
| Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 295 | libmincrypt \ | 
|  | 296 | libselinux \ | 
| Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 297 | libext4_utils_static \ | 
| Dan Albert | e246219 | 2015-03-19 13:25:27 -0700 | [diff] [blame] | 298 | libcutils \ | 
|  | 299 | libbase \ | 
| Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 300 |  | 
| Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 301 | include $(BUILD_EXECUTABLE) |