blob: e52f0cbef8a528918c5ee28a7f934485243f8a7d [file] [log] [blame]
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -08001# Copyright 2005 The Android Open Source Project
2#
3# Android.mk for adb
4#
5
6LOCAL_PATH:= $(call my-dir)
7
Elliott Hughescded7532017-05-08 11:30:34 -07008include $(LOCAL_PATH)/../platform_tools_tool_version.mk
9
Dan Albertfd0be892015-07-30 10:25:32 -070010adb_host_sanitize :=
11adb_target_sanitize :=
12
Dan Alberta8285fb2015-05-05 17:46:50 -070013ADB_COMMON_CFLAGS := \
Josh Gao395b86a2018-01-28 20:32:46 -080014 -frtti \
Dan Albertc6d3a242015-05-20 18:56:10 -070015 -Wall -Wextra -Werror \
Dan Albert7d8fc462015-07-08 13:50:42 -070016 -Wno-unused-parameter \
Dan Albert3d978e62015-07-09 20:35:09 +000017 -Wno-missing-field-initializers \
Elliott Hughes6c73bfc2015-10-27 13:40:35 -070018 -Wvla \
Elliott Hughes86d6b6c2017-05-10 08:41:33 -070019 -DADB_VERSION="\"$(tool_version)\"" \
Dan Alberta8285fb2015-05-05 17:46:50 -070020
Josh Gaoed4b7152017-05-03 14:01:35 -070021ADB_COMMON_posix_CFLAGS := \
Josh Gaoe3a87d02015-11-11 17:56:12 -080022 -Wexit-time-destructors \
Elliott Hughes86d6b6c2017-05-10 08:41:33 -070023 -Wthread-safety \
Josh Gaoed4b7152017-05-03 14:01:35 -070024
25ADB_COMMON_linux_CFLAGS := \
26 $(ADB_COMMON_posix_CFLAGS) \
Josh Gaoe3a87d02015-11-11 17:56:12 -080027
28ADB_COMMON_darwin_CFLAGS := \
Josh Gaoed4b7152017-05-03 14:01:35 -070029 $(ADB_COMMON_posix_CFLAGS) \
Josh Gaoe3a87d02015-11-11 17:56:12 -080030
Spencer Lowcc467f12015-08-02 18:13:54 -070031# Define windows.h and tchar.h Unicode preprocessor symbols so that
32# CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the
33# build if you accidentally pass char*. Fix by calling like:
Spencer Low50f5bf12015-11-12 15:20:15 -080034# std::wstring path_wide;
35# if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ }
36# CreateFileW(path_wide.c_str());
Spencer Lowcc467f12015-08-02 18:13:54 -070037ADB_COMMON_windows_CFLAGS := \
38 -DUNICODE=1 -D_UNICODE=1 \
39
Dan Albertbbbbea62014-11-24 23:34:35 -080040# libadb
41# =========================================================
42
43# Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes
44# made to adb rarely get ported to the other two, so the trees have diverged a
45# bit. We'd like to stop this because it is a maintenance nightmare, but the
46# divergence makes this difficult to do all at once. For now, we will start
47# small by moving common files into a static library. Hopefully some day we can
48# get enough of adb in here that we no longer need minadb. https://b/17626262
Dan Albert056ad0e2015-02-18 17:47:33 -080049LIBADB_SRC_FILES := \
Dan Albertf30d73c2015-02-25 17:51:28 -080050 adb.cpp \
Dan Albert66a91b02015-02-24 21:26:58 -080051 adb_io.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -080052 adb_listeners.cpp \
Yabin Cui19bec5b2015-09-22 15:52:57 -070053 adb_trace.cpp \
Elliott Hughes38104452015-04-17 13:57:15 -070054 adb_utils.cpp \
Josh Gaoe7388122016-02-16 17:34:53 -080055 fdevent.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -080056 sockets.cpp \
Josh Gao4a5a95d2016-08-24 18:38:44 -070057 socket_spec.cpp \
Josh Gaoa2cf3752016-12-05 17:11:34 -080058 sysdeps/errno.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -080059 transport.cpp \
60 transport_local.cpp \
61 transport_usb.cpp \
Dan Albert056ad0e2015-02-18 17:47:33 -080062
Elliott Hughesdf5bb432015-04-19 13:17:01 -070063LIBADB_TEST_SRCS := \
64 adb_io_test.cpp \
David Pursell19d0c232016-04-07 11:25:48 -070065 adb_listeners_test.cpp \
Elliott Hughesdf5bb432015-04-19 13:17:01 -070066 adb_utils_test.cpp \
Josh Gao511763b2016-02-10 14:49:00 -080067 fdevent_test.cpp \
Josh Gao3fb517c2016-09-19 17:31:55 -070068 socket_spec_test.cpp \
Josh Gao511763b2016-02-10 14:49:00 -080069 socket_test.cpp \
Josh Gaoa4f5e032016-02-09 14:59:09 -080070 sysdeps_test.cpp \
Josh Gaoa4f9c172016-07-28 18:09:48 -070071 sysdeps/stat_test.cpp \
Elliott Hughesdf5bb432015-04-19 13:17:01 -070072 transport_test.cpp \
73
Dan Albert357bd492015-02-20 17:20:09 -080074LIBADB_CFLAGS := \
Dan Alberta8285fb2015-05-05 17:46:50 -070075 $(ADB_COMMON_CFLAGS) \
Dan Albert056ad0e2015-02-18 17:47:33 -080076 -fvisibility=hidden \
Elliott Hughesbb4fe4a2015-07-24 14:32:46 -070077
78LIBADB_linux_CFLAGS := \
Josh Gaoe3a87d02015-11-11 17:56:12 -080079 $(ADB_COMMON_linux_CFLAGS) \
80
81LIBADB_darwin_CFLAGS := \
82 $(ADB_COMMON_darwin_CFLAGS) \
Dan Albertbbbbea62014-11-24 23:34:35 -080083
Dan Willemsen1cc079a2015-08-13 14:43:34 -070084LIBADB_windows_CFLAGS := \
85 $(ADB_COMMON_windows_CFLAGS) \
Elliott Hughesbb4fe4a2015-07-24 14:32:46 -070086
Dan Albertf30d73c2015-02-25 17:51:28 -080087LIBADB_darwin_SRC_FILES := \
David Pursellc25a34e2016-02-22 14:27:23 -080088 sysdeps_unix.cpp \
Josh Gao1f6a57a2017-04-12 13:57:06 -070089 sysdeps/posix/network.cpp \
Josh Gaob7366922016-09-28 12:32:45 -070090 client/usb_dispatch.cpp \
91 client/usb_libusb.cpp \
Josh Gao78f860e2017-01-19 13:44:23 -080092 client/usb_osx.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -080093
94LIBADB_linux_SRC_FILES := \
David Pursellc25a34e2016-02-22 14:27:23 -080095 sysdeps_unix.cpp \
Josh Gao1f6a57a2017-04-12 13:57:06 -070096 sysdeps/posix/network.cpp \
Josh Gaob7366922016-09-28 12:32:45 -070097 client/usb_dispatch.cpp \
98 client/usb_libusb.cpp \
Josh Gao78f860e2017-01-19 13:44:23 -080099 client/usb_linux.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -0800100
101LIBADB_windows_SRC_FILES := \
Elliott Hughes6a096932015-04-16 16:47:02 -0700102 sysdeps_win32.cpp \
Josh Gao75e96bb2016-12-05 13:24:48 -0800103 sysdeps/win32/errno.cpp \
Josh Gaoa4f9c172016-07-28 18:09:48 -0700104 sysdeps/win32/stat.cpp \
Josh Gao511ff8a2017-12-08 13:05:40 -0800105 client/usb_dispatch.cpp \
106 client/usb_libusb.cpp \
Josh Gao78f860e2017-01-19 13:44:23 -0800107 client/usb_windows.cpp \
Dan Albertdfef94a2014-11-25 11:00:56 -0800108
Spencer Low50740f52015-09-08 17:13:04 -0700109LIBADB_TEST_windows_SRCS := \
Josh Gao75e96bb2016-12-05 13:24:48 -0800110 sysdeps/win32/errno_test.cpp \
Spencer Low50740f52015-09-08 17:13:04 -0700111 sysdeps_win32_test.cpp \
112
Dan Albertdfef94a2014-11-25 11:00:56 -0800113include $(CLEAR_VARS)
Josh Gao484aaba2017-01-11 17:37:35 -0800114LOCAL_MODULE := libadbd_usb
Dan Albertdfef94a2014-11-25 11:00:56 -0800115LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
Josh Gao484aaba2017-01-11 17:37:35 -0800116LOCAL_SRC_FILES := daemon/usb.cpp
Dan Albert052c2532015-02-18 17:20:44 -0800117
Dan Albertfd0be892015-07-30 10:25:32 -0700118LOCAL_SANITIZE := $(adb_target_sanitize)
Elliott Hughesa585cbd2015-04-20 08:09:20 -0700119
Dan Albert27929b02015-03-19 13:25:27 -0700120# Even though we're building a static library (and thus there's no link step for
121# this to take effect), this adds the includes to our path.
Jerry Zhanga2cb8de2017-07-18 14:07:57 -0700122LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libasyncio
Dan Albert27929b02015-03-19 13:25:27 -0700123
Dan Albertdfef94a2014-11-25 11:00:56 -0800124include $(BUILD_STATIC_LIBRARY)
125
Dan Albertbbbbea62014-11-24 23:34:35 -0800126include $(CLEAR_VARS)
Josh Gao484aaba2017-01-11 17:37:35 -0800127LOCAL_MODULE := libadbd
128LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
129LOCAL_SRC_FILES := \
130 $(LIBADB_SRC_FILES) \
131 adbd_auth.cpp \
132 jdwp_service.cpp \
Josh Gao1f6a57a2017-04-12 13:57:06 -0700133 sysdeps/posix/network.cpp \
Josh Gao484aaba2017-01-11 17:37:35 -0800134
135LOCAL_SANITIZE := $(adb_target_sanitize)
136
137# Even though we're building a static library (and thus there's no link step for
138# this to take effect), this adds the includes to our path.
bohu90a18d22017-03-29 12:19:40 -0700139LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libqemu_pipe libbase
Josh Gao484aaba2017-01-11 17:37:35 -0800140
141LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb
142
143include $(BUILD_STATIC_LIBRARY)
144
145include $(CLEAR_VARS)
Dan Albertbbbbea62014-11-24 23:34:35 -0800146LOCAL_MODULE := libadb
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700147LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albertdfef94a2014-11-25 11:00:56 -0800148LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700149LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS)
150LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS)
Josh Gaoe3a87d02015-11-11 17:56:12 -0800151LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS)
Dan Albert01c58ca2015-02-19 13:19:42 -0800152LOCAL_SRC_FILES := \
153 $(LIBADB_SRC_FILES) \
Casey Dahlin20238f22016-09-21 14:03:39 -0700154 adb_auth_host.cpp \
155 transport_mdns.cpp \
Dan Albertbbbbea62014-11-24 23:34:35 -0800156
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700157LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES)
158LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES)
159LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES)
160
Dan Albertfd0be892015-07-30 10:25:32 -0700161LOCAL_SANITIZE := $(adb_host_sanitize)
Elliott Hughesa585cbd2015-04-20 08:09:20 -0700162
Dan Albert01c58ca2015-02-19 13:19:42 -0800163# Even though we're building a static library (and thus there's no link step for
Dan Albert27929b02015-03-19 13:25:27 -0700164# this to take effect), this adds the includes to our path.
Josh Gao511ff8a2017-12-08 13:05:40 -0800165LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd libusb
Dan Albert01c58ca2015-02-19 13:19:42 -0800166
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700167LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/
Dan Willemsen74e85682015-09-03 20:29:56 -0700168LOCAL_MULTILIB := first
Dan Albert8ce32132015-02-24 14:08:03 -0800169
Dan Albertbbbbea62014-11-24 23:34:35 -0800170include $(BUILD_HOST_STATIC_LIBRARY)
171
Dan Albert4895c522015-02-20 17:24:58 -0800172include $(CLEAR_VARS)
Dan Albert4895c522015-02-20 17:24:58 -0800173LOCAL_MODULE := adbd_test
174LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS)
Yabin Cui7c92f0a2015-08-28 15:44:27 -0700175LOCAL_SRC_FILES := \
176 $(LIBADB_TEST_SRCS) \
177 $(LIBADB_TEST_linux_SRCS) \
David Pursell8da19a42015-08-31 10:42:13 -0700178 shell_service.cpp \
David Purselld0df2dd2015-08-31 15:36:18 -0700179 shell_service_protocol.cpp \
180 shell_service_protocol_test.cpp \
David Pursell8da19a42015-08-31 10:42:13 -0700181 shell_service_test.cpp \
Yabin Cui7c92f0a2015-08-28 15:44:27 -0700182
Dan Albertfd0be892015-07-30 10:25:32 -0700183LOCAL_SANITIZE := $(adb_target_sanitize)
Casey Dahlin20238f22016-09-21 14:03:39 -0700184LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd
Dimitry Ivanov53b3ac52016-02-12 18:40:29 -0800185LOCAL_SHARED_LIBRARIES := liblog libbase libcutils
Dan Albert4895c522015-02-20 17:24:58 -0800186include $(BUILD_NATIVE_TEST)
187
Elliott Hughes70097492015-12-11 19:07:01 -0800188# libdiagnose_usb
189# =========================================================
190
191include $(CLEAR_VARS)
192LOCAL_MODULE := libdiagnose_usb
193LOCAL_MODULE_HOST_OS := darwin linux windows
194LOCAL_CFLAGS := $(LIBADB_CFLAGS)
195LOCAL_SRC_FILES := diagnose_usb.cpp
196# Even though we're building a static library (and thus there's no link step for
197# this to take effect), this adds the includes to our path.
198LOCAL_STATIC_LIBRARIES := libbase
199include $(BUILD_HOST_STATIC_LIBRARY)
200
Spencer Lowc9ddd812015-05-24 15:36:28 -0700201# adb_test
202# =========================================================
203
Dan Albert4895c522015-02-20 17:24:58 -0800204include $(CLEAR_VARS)
Dan Albert4895c522015-02-20 17:24:58 -0800205LOCAL_MODULE := adb_test
Spencer Low639cea42015-09-07 23:39:02 -0700206LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albert4895c522015-02-20 17:24:58 -0800207LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS)
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700208LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS)
209LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS)
Josh Gaoe3a87d02015-11-11 17:56:12 -0800210LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS)
David Purselld0df2dd2015-08-31 15:36:18 -0700211LOCAL_SRC_FILES := \
212 $(LIBADB_TEST_SRCS) \
Felipe Leme042c3512016-07-19 17:07:22 -0700213 adb_client.cpp \
214 bugreport.cpp \
215 bugreport_test.cpp \
Felipe Lemee53b12b2016-07-26 12:23:40 -0700216 line_printer.cpp \
David Purselld0df2dd2015-08-31 15:36:18 -0700217 services.cpp \
218 shell_service_protocol.cpp \
219 shell_service_protocol_test.cpp \
220
David Pursell7616ae12015-09-11 16:06:59 -0700221LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS)
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700222LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS)
Spencer Low50740f52015-09-08 17:13:04 -0700223LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS)
Dan Albertfd0be892015-07-30 10:25:32 -0700224LOCAL_SANITIZE := $(adb_host_sanitize)
Dan Albert4895c522015-02-20 17:24:58 -0800225LOCAL_STATIC_LIBRARIES := \
226 libadb \
Josh Gao3e02d0e2017-04-12 17:04:41 -0700227 libbase \
Josh Gaoefe6afa2016-08-05 15:47:57 -0700228 libcrypto_utils \
229 libcrypto \
Dan Albert4895c522015-02-20 17:24:58 -0800230 libcutils \
Elliott Hughes70097492015-12-11 19:07:01 -0800231 libdiagnose_usb \
Casey Dahlin20238f22016-09-21 14:03:39 -0700232 libmdnssd \
Elliott Hughes86d6b6c2017-05-10 08:41:33 -0700233 libgmock_host \
Josh Gao511ff8a2017-12-08 13:05:40 -0800234 libusb \
Josh Gaob7366922016-09-28 12:32:45 -0700235
Spencer Low50740f52015-09-08 17:13:04 -0700236# Set entrypoint to wmain from sysdeps_win32.cpp instead of main
237LOCAL_LDFLAGS_windows := -municode
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700238LOCAL_LDLIBS_linux := -lrt -ldl -lpthread
Josh Gaob7366922016-09-28 12:32:45 -0700239LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc
Josh Gao1cd58572017-02-23 13:16:52 -0800240LOCAL_LDLIBS_windows := -lws2_32 -luserenv
Josh Gao640d4452018-01-08 16:45:30 -0800241LOCAL_SHARED_LIBRARIES_windows := AdbWinApi
Dan Albert4895c522015-02-20 17:24:58 -0800242
Dan Willemsenc6aa5d62015-12-21 16:14:31 -0800243LOCAL_MULTILIB := first
244
Spencer Lowc9ddd812015-05-24 15:36:28 -0700245include $(BUILD_HOST_NATIVE_TEST)
246
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800247# adb host tool
248# =========================================================
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800249include $(CLEAR_VARS)
250
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700251LOCAL_LDLIBS_linux := -lrt -ldl -lpthread
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800252
Josh Gaob7366922016-09-28 12:32:45 -0700253LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon -lobjc
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800254
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700255# Use wmain instead of main
256LOCAL_LDFLAGS_windows := -municode
Josh Gao1cd58572017-02-23 13:16:52 -0800257LOCAL_LDLIBS_windows := -lws2_32 -lgdi32
Josh Gao640d4452018-01-08 16:45:30 -0800258LOCAL_SHARED_LIBRARIES_windows := AdbWinApi
259LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi
Dan Albert250e58c2015-02-20 17:28:44 -0800260
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800261LOCAL_SRC_FILES := \
Elliott Hughesf5cdc1d2015-10-27 16:03:15 -0700262 adb_client.cpp \
Felipe Leme042c3512016-07-19 17:07:22 -0700263 bugreport.cpp \
Dan Albert53a37442015-05-08 16:13:53 -0700264 client/main.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -0800265 console.cpp \
266 commandline.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -0800267 file_sync_client.cpp \
Elliott Hughesf5cdc1d2015-10-27 16:03:15 -0700268 line_printer.cpp \
269 services.cpp \
David Purselld0df2dd2015-08-31 15:36:18 -0700270 shell_service_protocol.cpp \
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800271
Dan Albert50f9b902015-02-24 22:38:21 -0800272LOCAL_CFLAGS += \
Dan Alberta8285fb2015-05-05 17:46:50 -0700273 $(ADB_COMMON_CFLAGS) \
Dan Albert50f9b902015-02-24 22:38:21 -0800274 -D_GNU_SOURCE \
275 -DADB_HOST=1 \
276
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700277LOCAL_CFLAGS_windows := \
278 $(ADB_COMMON_windows_CFLAGS)
279
Josh Gaoe3a87d02015-11-11 17:56:12 -0800280LOCAL_CFLAGS_linux := \
281 $(ADB_COMMON_linux_CFLAGS) \
282
283LOCAL_CFLAGS_darwin := \
284 $(ADB_COMMON_darwin_CFLAGS) \
285 -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \
286
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800287LOCAL_MODULE := adb
Benoit Goby12dc3692013-02-20 15:04:53 -0800288LOCAL_MODULE_TAGS := debug
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700289LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800290
Dan Albertfd0be892015-07-30 10:25:32 -0700291LOCAL_SANITIZE := $(adb_host_sanitize)
Dan Albertbbbbea62014-11-24 23:34:35 -0800292LOCAL_STATIC_LIBRARIES := \
293 libadb \
Elliott Hughes170b5682015-04-17 10:59:34 -0700294 libbase \
Josh Gaoefe6afa2016-08-05 15:47:57 -0700295 libcrypto_utils \
296 libcrypto \
Elliott Hughes70097492015-12-11 19:07:01 -0800297 libdiagnose_usb \
Casey Dahlin20238f22016-09-21 14:03:39 -0700298 liblog \
Elliott Hughes86d6b6c2017-05-10 08:41:33 -0700299 libmdnssd \
Josh Gao511ff8a2017-12-08 13:05:40 -0800300 libusb \
Dan Albertbbbbea62014-11-24 23:34:35 -0800301
Josh Gaof5570b82015-11-13 17:55:45 -0800302# Don't use libcutils on Windows.
303LOCAL_STATIC_LIBRARIES_darwin := libcutils
Casey Dahlin20238f22016-09-21 14:03:39 -0700304LOCAL_STATIC_LIBRARIES_linux := libcutils
Josh Gaof5570b82015-11-13 17:55:45 -0800305
Dan Willemsen1cc079a2015-08-13 14:43:34 -0700306LOCAL_CXX_STL := libc++_static
Colin Cross0a34bfb2015-04-16 16:21:44 -0700307
308# Don't add anything here, we don't want additional shared dependencies
309# on the host adb tool, and shared libraries that link against libc++
310# will violate ODR
311LOCAL_SHARED_LIBRARIES :=
312
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800313include $(BUILD_HOST_EXECUTABLE)
314
Ying Wang458321a2016-02-29 19:27:06 -0800315$(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE))
316ifdef HOST_CROSS_OS
317# Archive adb.exe for win_sdk build.
318$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT))
319endif
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800320
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800321
322# adbd device daemon
323# =========================================================
324
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800325include $(CLEAR_VARS)
326
327LOCAL_SRC_FILES := \
Dan Albert53a37442015-05-08 16:13:53 -0700328 daemon/main.cpp \
Casey Dahlin10ad15f2016-05-06 16:19:13 -0700329 daemon/mdns.cpp \
Dan Albertf30d73c2015-02-25 17:51:28 -0800330 services.cpp \
331 file_sync_service.cpp \
332 framebuffer_service.cpp \
333 remount_service.cpp \
334 set_verity_enable_state_service.cpp \
David Pursell4f344bb2015-08-28 15:08:49 -0700335 shell_service.cpp \
David Purselld0df2dd2015-08-31 15:36:18 -0700336 shell_service_protocol.cpp \
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800337
Christopher Ferrisd9306912014-09-03 19:48:48 -0700338LOCAL_CFLAGS := \
Dan Alberta8285fb2015-05-05 17:46:50 -0700339 $(ADB_COMMON_CFLAGS) \
Josh Gaoe3a87d02015-11-11 17:56:12 -0800340 $(ADB_COMMON_linux_CFLAGS) \
Dan Albertf30d73c2015-02-25 17:51:28 -0800341 -DADB_HOST=0 \
342 -D_GNU_SOURCE \
Dan Albertf30d73c2015-02-25 17:51:28 -0800343 -Wno-deprecated-declarations \
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800344
Elliott Hughesd7eb8542015-06-17 15:23:42 -0700345LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
Nick Kralevich09264032012-01-19 13:11:35 -0800346
Elliott Hughesdedf7672015-03-16 21:58:32 +0000347ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Paul Lawrence5f356482014-10-09 14:22:49 +0000348LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
Bowgo Tsai71e154f2017-08-31 06:26:47 +0000349LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
Paul Lawrence5f356482014-10-09 14:22:49 +0000350endif
351
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800352LOCAL_MODULE := adbd
353
354LOCAL_FORCE_STATIC_EXECUTABLE := true
The Android Open Source Project9ca14dc2009-03-03 19:32:55 -0800355
Dan Albertfd0be892015-07-30 10:25:32 -0700356LOCAL_SANITIZE := $(adb_target_sanitize)
Josh Gaoab5449d2016-06-15 18:33:11 -0700357LOCAL_STRIP_MODULE := keep_symbols
Dan Albertbbbbea62014-11-24 23:34:35 -0800358LOCAL_STATIC_LIBRARIES := \
Dan Albertdfef94a2014-11-25 11:00:56 -0800359 libadbd \
Jerry Zhanga2cb8de2017-07-18 14:07:57 -0700360 libasyncio \
David Zeuthen499ad6c2017-04-12 16:07:06 -0400361 libavb_user \
Tao Bao0db67642015-03-29 11:22:34 -0700362 libbase \
bohu90a18d22017-03-29 12:19:40 -0700363 libqemu_pipe \
Tao Baoa8c21dc2017-01-05 18:01:01 -0800364 libbootloader_message \
Dan Albert0ca996b2015-01-26 17:13:54 -0800365 libfs_mgr \
Sami Tolvanen778f5002015-10-20 13:24:24 +0100366 libfec \
367 libfec_rs \
William Roberts075c8522015-08-04 14:23:04 -0700368 libselinux \
Dan Albertbbbbea62014-11-24 23:34:35 -0800369 liblog \
Alex Deymof2c86992017-01-11 14:03:11 -0800370 libext4_utils \
Sami Tolvanen778f5002015-10-20 13:24:24 +0100371 libsquashfs_utils \
Dan Albert27929b02015-03-19 13:25:27 -0700372 libcutils \
373 libbase \
Josh Gaoefe6afa2016-08-05 15:47:57 -0700374 libcrypto_utils \
375 libcrypto \
Josh Gaoab5449d2016-06-15 18:33:11 -0700376 libminijail \
Casey Dahlin10ad15f2016-05-06 16:19:13 -0700377 libmdnssd \
Josh Gao690b0a92016-10-18 18:17:52 -0700378 libdebuggerd_handler \
Paul Lawrence5f356482014-10-09 14:22:49 +0000379
Jeff Brownf5287b72011-07-11 22:12:32 -0700380include $(BUILD_EXECUTABLE)
Josh Gao484aaba2017-01-11 17:37:35 -0800381
GuangHui Liu35994392017-05-10 14:37:17 -0700382# adb integration test
383# =========================================================
384$(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_adb.BUILT))
385$(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_device.BUILT))
386
Josh Gao484aaba2017-01-11 17:37:35 -0800387include $(call first-makefiles-under,$(LOCAL_PATH))