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