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) |
| 9 | adb_host_clang := false # libc++ for mingw not ready yet. |
| 10 | else |
| 11 | adb_host_clang := true |
| 12 | endif |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 13 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 14 | # libadb |
| 15 | # ========================================================= |
| 16 | |
| 17 | # Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes |
| 18 | # made to adb rarely get ported to the other two, so the trees have diverged a |
| 19 | # bit. We'd like to stop this because it is a maintenance nightmare, but the |
| 20 | # divergence makes this difficult to do all at once. For now, we will start |
| 21 | # small by moving common files into a static library. Hopefully some day we can |
| 22 | # 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] | 23 | LIBADB_SRC_FILES := \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 24 | adb.cpp \ |
| 25 | adb_auth.cpp \ |
Dan Albert | cc731cc | 2015-02-24 21:26:58 -0800 | [diff] [blame] | 26 | adb_io.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 27 | adb_listeners.cpp \ |
Elliott Hughes | 5830577 | 2015-04-17 13:57:15 -0700 | [diff] [blame] | 28 | adb_utils.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 29 | sockets.cpp \ |
| 30 | transport.cpp \ |
| 31 | transport_local.cpp \ |
| 32 | transport_usb.cpp \ |
Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 33 | |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 34 | LIBADB_TEST_SRCS := \ |
| 35 | adb_io_test.cpp \ |
| 36 | adb_utils_test.cpp \ |
| 37 | transport_test.cpp \ |
| 38 | |
Dan Albert | bf10647 | 2015-02-20 17:20:09 -0800 | [diff] [blame] | 39 | LIBADB_CFLAGS := \ |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 40 | -Wall -Werror \ |
| 41 | -Wno-unused-parameter \ |
| 42 | -Wno-missing-field-initializers \ |
Dan Albert | ba3a251 | 2015-02-18 17:47:33 -0800 | [diff] [blame] | 43 | -fvisibility=hidden \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 44 | |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 45 | LIBADB_darwin_SRC_FILES := \ |
| 46 | fdevent.cpp \ |
Elliott Hughes | 1a4d85a | 2015-04-16 13:24:58 -0700 | [diff] [blame] | 47 | get_my_path_darwin.cpp \ |
Dan Albert | 7447dd0 | 2015-04-16 19:20:40 -0700 | [diff] [blame] | 48 | usb_osx.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 49 | |
| 50 | LIBADB_linux_SRC_FILES := \ |
| 51 | fdevent.cpp \ |
| 52 | get_my_path_linux.cpp \ |
| 53 | usb_linux.cpp \ |
| 54 | |
| 55 | LIBADB_windows_SRC_FILES := \ |
| 56 | get_my_path_windows.cpp \ |
Elliott Hughes | a2f2e56 | 2015-04-16 16:47:02 -0700 | [diff] [blame] | 57 | sysdeps_win32.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 58 | usb_windows.cpp \ |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 59 | |
| 60 | include $(CLEAR_VARS) |
Elliott Hughes | 2acec91 | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 61 | LOCAL_CLANG := true |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 62 | LOCAL_MODULE := libadbd |
| 63 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 |
Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 64 | LOCAL_SRC_FILES := \ |
| 65 | $(LIBADB_SRC_FILES) \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 66 | adb_auth_client.cpp \ |
Dan Albert | 3c43858 | 2015-02-20 17:24:30 -0800 | [diff] [blame] | 67 | fdevent.cpp \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 68 | jdwp_service.cpp \ |
| 69 | qemu_tracing.cpp \ |
Elliott Hughes | 2acec91 | 2015-04-16 14:12:50 -0700 | [diff] [blame] | 70 | usb_linux_client.cpp \ |
Dan Albert | 21c3eaf | 2015-02-18 17:20:44 -0800 | [diff] [blame] | 71 | |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 72 | include $(BUILD_STATIC_LIBRARY) |
| 73 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 74 | include $(CLEAR_VARS) |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 75 | LOCAL_CLANG := $(adb_host_clang) |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 76 | LOCAL_MODULE := libadb |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 77 | LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 78 | LOCAL_SRC_FILES := \ |
| 79 | $(LIBADB_SRC_FILES) \ |
Dan Albert | 3c43858 | 2015-02-20 17:24:30 -0800 | [diff] [blame] | 80 | $(LIBADB_$(HOST_OS)_SRC_FILES) \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 81 | adb_auth_host.cpp \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 82 | |
Dan Albert | e1ca623 | 2015-02-19 13:19:42 -0800 | [diff] [blame] | 83 | # Even though we're building a static library (and thus there's no link step for |
| 84 | # this to take effect), this adds the SSL includes to our path. |
| 85 | LOCAL_STATIC_LIBRARIES := libcrypto_static |
| 86 | |
Dan Albert | 88cf1c8 | 2015-02-24 14:08:03 -0800 | [diff] [blame] | 87 | ifeq ($(HOST_OS),windows) |
| 88 | LOCAL_C_INCLUDES += development/host/windows/usb/api/ |
| 89 | endif |
| 90 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 91 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 92 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 93 | include $(CLEAR_VARS) |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 94 | LOCAL_CLANG := true |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 95 | LOCAL_MODULE := adbd_test |
| 96 | LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS) |
| 97 | LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS) |
| 98 | LOCAL_STATIC_LIBRARIES := libadbd |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 99 | LOCAL_SHARED_LIBRARIES := liblog libbase libcutils |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 100 | include $(BUILD_NATIVE_TEST) |
| 101 | |
| 102 | include $(CLEAR_VARS) |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 103 | LOCAL_CLANG := $(adb_host_clang) |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 104 | LOCAL_MODULE := adb_test |
| 105 | LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS) |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 106 | LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS) services.cpp |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 107 | LOCAL_SHARED_LIBRARIES := liblog libbase |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 108 | LOCAL_STATIC_LIBRARIES := \ |
| 109 | libadb \ |
| 110 | libcrypto_static \ |
| 111 | libcutils \ |
| 112 | |
| 113 | ifeq ($(HOST_OS),linux) |
| 114 | LOCAL_LDLIBS += -lrt -ldl -lpthread |
| 115 | endif |
| 116 | |
Dan Albert | f8d6b9b | 2015-04-16 19:13:58 -0700 | [diff] [blame] | 117 | ifeq ($(HOST_OS),darwin) |
| 118 | LOCAL_LDLIBS += -framework CoreFoundation -framework IOKit |
| 119 | endif |
| 120 | |
Dan Albert | 055f1aa | 2015-02-20 17:24:58 -0800 | [diff] [blame] | 121 | include $(BUILD_HOST_NATIVE_TEST) |
| 122 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 123 | # adb host tool |
| 124 | # ========================================================= |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 125 | include $(CLEAR_VARS) |
| 126 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 127 | ifeq ($(HOST_OS),linux) |
Chih-Wei Huang | 9c60755 | 2013-01-01 15:24:33 +0800 | [diff] [blame] | 128 | LOCAL_LDLIBS += -lrt -ldl -lpthread |
JP Abgrall | 571c136 | 2012-12-06 18:18:12 -0800 | [diff] [blame] | 129 | LOCAL_CFLAGS += -DWORKAROUND_BUG6558362 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 130 | endif |
| 131 | |
| 132 | ifeq ($(HOST_OS),darwin) |
Benoit Goby | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 133 | LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon |
Tim Murray | 1efcdef | 2014-07-24 18:33:12 -0700 | [diff] [blame] | 134 | LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 135 | endif |
| 136 | |
| 137 | ifeq ($(HOST_OS),windows) |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 138 | LOCAL_LDLIBS += -lws2_32 -lgdi32 |
Benoit Goby | 345ca13 | 2012-08-31 17:44:27 -0700 | [diff] [blame] | 139 | EXTRA_STATIC_LIBS := AdbWinApi |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 140 | endif |
| 141 | |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 142 | LOCAL_CLANG := $(adb_host_clang) |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 143 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 144 | LOCAL_SRC_FILES := \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 145 | adb_main.cpp \ |
| 146 | console.cpp \ |
| 147 | commandline.cpp \ |
| 148 | adb_client.cpp \ |
| 149 | services.cpp \ |
| 150 | file_sync_client.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 151 | |
Dan Albert | 7fd821e | 2015-02-24 22:38:21 -0800 | [diff] [blame] | 152 | LOCAL_CFLAGS += \ |
| 153 | -Wall -Werror \ |
| 154 | -Wno-unused-parameter \ |
| 155 | -D_GNU_SOURCE \ |
| 156 | -DADB_HOST=1 \ |
| 157 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 158 | LOCAL_MODULE := adb |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 159 | LOCAL_MODULE_TAGS := debug |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 160 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 161 | LOCAL_STATIC_LIBRARIES := \ |
| 162 | libadb \ |
Elliott Hughes | 2baae3a | 2015-04-17 10:59:34 -0700 | [diff] [blame] | 163 | libbase \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 164 | libcrypto_static \ |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 165 | libcutils \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 166 | $(EXTRA_STATIC_LIBS) \ |
| 167 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 168 | include $(BUILD_HOST_EXECUTABLE) |
| 169 | |
Ying Wang | 96535ba | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 170 | $(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] | 171 | |
| 172 | ifeq ($(HOST_OS),windows) |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 173 | $(LOCAL_INSTALLED_MODULE): \ |
| 174 | $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ |
| 175 | $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 176 | endif |
| 177 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 178 | |
| 179 | # adbd device daemon |
| 180 | # ========================================================= |
| 181 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 182 | include $(CLEAR_VARS) |
| 183 | |
Elliott Hughes | 53daee6 | 2015-04-19 13:17:01 -0700 | [diff] [blame^] | 184 | LOCAL_CLANG := true |
Dan Albert | 9697ce5 | 2015-02-20 17:28:44 -0800 | [diff] [blame] | 185 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 186 | LOCAL_SRC_FILES := \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 187 | adb_main.cpp \ |
| 188 | services.cpp \ |
| 189 | file_sync_service.cpp \ |
| 190 | framebuffer_service.cpp \ |
| 191 | remount_service.cpp \ |
| 192 | set_verity_enable_state_service.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 193 | |
Christopher Ferris | 51448eb | 2014-09-03 19:48:48 -0700 | [diff] [blame] | 194 | LOCAL_CFLAGS := \ |
Dan Albert | bac3474 | 2015-02-25 17:51:28 -0800 | [diff] [blame] | 195 | -DADB_HOST=0 \ |
| 196 | -D_GNU_SOURCE \ |
| 197 | -Wall -Werror \ |
| 198 | -Wno-unused-parameter \ |
| 199 | -Wno-deprecated-declarations \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 200 | |
Nick Kralevich | 5890fe3 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 201 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
| 202 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
| 203 | endif |
| 204 | |
Elliott Hughes | ec7a667 | 2015-03-16 21:58:32 +0000 | [diff] [blame] | 205 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 206 | LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1 |
| 207 | endif |
| 208 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 209 | LOCAL_MODULE := adbd |
| 210 | |
| 211 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 212 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 213 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 214 | LOCAL_C_INCLUDES += system/extras/ext4_utils |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 215 | |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 216 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | 9449376 | 2014-11-25 11:00:56 -0800 | [diff] [blame] | 217 | libadbd \ |
Tao Bao | 175b7bb | 2015-03-29 11:22:34 -0700 | [diff] [blame] | 218 | libbase \ |
Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 219 | libfs_mgr \ |
Dan Albert | 630b9af | 2014-11-24 23:34:35 -0800 | [diff] [blame] | 220 | liblog \ |
| 221 | libcutils \ |
| 222 | libc \ |
| 223 | libmincrypt \ |
| 224 | libselinux \ |
Dan Albert | 030b76f | 2015-01-26 17:13:54 -0800 | [diff] [blame] | 225 | libext4_utils_static \ |
Paul Lawrence | ec900bb | 2014-10-09 14:22:49 +0000 | [diff] [blame] | 226 | |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 227 | include $(BUILD_EXECUTABLE) |