blob: b63cce03ea901a691f8cf65ef25d7fd9a994f816 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-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 Hughes4d4f64f2017-05-08 11:30:34 -07008include $(LOCAL_PATH)/../platform_tools_tool_version.mk
9
Dan Albert9113b472015-07-30 10:25:32 -070010adb_host_sanitize :=
11adb_target_sanitize :=
12
Dan Albert1ba1d7c2015-05-05 17:46:50 -070013ADB_COMMON_CFLAGS := \
Dan Albert23fee8f2015-05-20 18:56:10 -070014 -Wall -Wextra -Werror \
Dan Albert459df8f2015-07-08 13:50:42 -070015 -Wno-unused-parameter \
Dan Albert286bb6d2015-07-09 20:35:09 +000016 -Wno-missing-field-initializers \
Elliott Hughes6d929972015-10-27 13:40:35 -070017 -Wvla \
Elliott Hughes8964fbf2017-05-10 08:41:33 -070018 -DADB_VERSION="\"$(tool_version)\"" \
Dan Albert1ba1d7c2015-05-05 17:46:50 -070019
Josh Gao68f679c2017-05-03 14:01:35 -070020ADB_COMMON_posix_CFLAGS := \
Josh Gaob7b1edf2015-11-11 17:56:12 -080021 -Wexit-time-destructors \
Elliott Hughes8964fbf2017-05-10 08:41:33 -070022 -Wthread-safety \
Josh Gao68f679c2017-05-03 14:01:35 -070023
24ADB_COMMON_linux_CFLAGS := \
25 $(ADB_COMMON_posix_CFLAGS) \
Josh Gaob7b1edf2015-11-11 17:56:12 -080026
27ADB_COMMON_darwin_CFLAGS := \
Josh Gao68f679c2017-05-03 14:01:35 -070028 $(ADB_COMMON_posix_CFLAGS) \
Josh Gaob7b1edf2015-11-11 17:56:12 -080029
Spencer Lowe347c1d2015-08-02 18:13:54 -070030# Define windows.h and tchar.h Unicode preprocessor symbols so that
31# CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the
32# build if you accidentally pass char*. Fix by calling like:
Spencer Lowd21dc822015-11-12 15:20:15 -080033# std::wstring path_wide;
34# if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ }
35# CreateFileW(path_wide.c_str());
Spencer Lowe347c1d2015-08-02 18:13:54 -070036ADB_COMMON_windows_CFLAGS := \
37 -DUNICODE=1 -D_UNICODE=1 \
38
Dan Albert630b9af2014-11-24 23:34:35 -080039# libadb
40# =========================================================
41
42# Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes
43# made to adb rarely get ported to the other two, so the trees have diverged a
44# bit. We'd like to stop this because it is a maintenance nightmare, but the
45# divergence makes this difficult to do all at once. For now, we will start
46# small by moving common files into a static library. Hopefully some day we can
47# get enough of adb in here that we no longer need minadb. https://b/17626262
Dan Albertba3a2512015-02-18 17:47:33 -080048LIBADB_SRC_FILES := \
Dan Albertbac34742015-02-25 17:51:28 -080049 adb.cpp \
Dan Albertcc731cc2015-02-24 21:26:58 -080050 adb_io.cpp \
Dan Albertbac34742015-02-25 17:51:28 -080051 adb_listeners.cpp \
Yabin Cuiaed3c612015-09-22 15:52:57 -070052 adb_trace.cpp \
Elliott Hughes58305772015-04-17 13:57:15 -070053 adb_utils.cpp \
Josh Gao3777d2e2016-02-16 17:34:53 -080054 fdevent.cpp \
Dan Albertbac34742015-02-25 17:51:28 -080055 sockets.cpp \
Josh Gaocfb21412016-08-24 18:38:44 -070056 socket_spec.cpp \
Josh Gao5a1e3fd2016-12-05 17:11:34 -080057 sysdeps/errno.cpp \
Dan Albertbac34742015-02-25 17:51:28 -080058 transport.cpp \
59 transport_local.cpp \
60 transport_usb.cpp \
Dan Albertba3a2512015-02-18 17:47:33 -080061
Elliott Hughes53daee62015-04-19 13:17:01 -070062LIBADB_TEST_SRCS := \
63 adb_io_test.cpp \
David Purselleaae97e2016-04-07 11:25:48 -070064 adb_listeners_test.cpp \
Elliott Hughes53daee62015-04-19 13:17:01 -070065 adb_utils_test.cpp \
Josh Gao022d4472016-02-10 14:49:00 -080066 fdevent_test.cpp \
Josh Gao10992152016-09-19 17:31:55 -070067 socket_spec_test.cpp \
Josh Gao022d4472016-02-10 14:49:00 -080068 socket_test.cpp \
Josh Gao3b3e10d2016-02-09 14:59:09 -080069 sysdeps_test.cpp \
Josh Gaof551ea02016-07-28 18:09:48 -070070 sysdeps/stat_test.cpp \
Elliott Hughes53daee62015-04-19 13:17:01 -070071 transport_test.cpp \
72
Dan Albertbf106472015-02-20 17:20:09 -080073LIBADB_CFLAGS := \
Dan Albert1ba1d7c2015-05-05 17:46:50 -070074 $(ADB_COMMON_CFLAGS) \
Dan Albertba3a2512015-02-18 17:47:33 -080075 -fvisibility=hidden \
Elliott Hughes4f1d7b52015-07-24 14:32:46 -070076
77LIBADB_linux_CFLAGS := \
Josh Gaob7b1edf2015-11-11 17:56:12 -080078 $(ADB_COMMON_linux_CFLAGS) \
79
80LIBADB_darwin_CFLAGS := \
81 $(ADB_COMMON_darwin_CFLAGS) \
Dan Albert630b9af2014-11-24 23:34:35 -080082
Dan Willemsen87a419c2015-08-13 14:43:34 -070083LIBADB_windows_CFLAGS := \
84 $(ADB_COMMON_windows_CFLAGS) \
Elliott Hughes4f1d7b52015-07-24 14:32:46 -070085
Dan Albertbac34742015-02-25 17:51:28 -080086LIBADB_darwin_SRC_FILES := \
David Pursellbfd95032016-02-22 14:27:23 -080087 sysdeps_unix.cpp \
Josh Gao46de1d72017-04-12 13:57:06 -070088 sysdeps/posix/network.cpp \
Josh Gao1c70e1b2016-09-28 12:32:45 -070089 client/usb_dispatch.cpp \
90 client/usb_libusb.cpp \
Josh Gao456e1ad2017-01-19 13:44:23 -080091 client/usb_osx.cpp \
Dan Albertbac34742015-02-25 17:51:28 -080092
93LIBADB_linux_SRC_FILES := \
David Pursellbfd95032016-02-22 14:27:23 -080094 sysdeps_unix.cpp \
Josh Gao46de1d72017-04-12 13:57:06 -070095 sysdeps/posix/network.cpp \
Josh Gao1c70e1b2016-09-28 12:32:45 -070096 client/usb_dispatch.cpp \
97 client/usb_libusb.cpp \
Josh Gao456e1ad2017-01-19 13:44:23 -080098 client/usb_linux.cpp \
Dan Albertbac34742015-02-25 17:51:28 -080099
100LIBADB_windows_SRC_FILES := \
Elliott Hughesa2f2e562015-04-16 16:47:02 -0700101 sysdeps_win32.cpp \
Josh Gaoa3577e12016-12-05 13:24:48 -0800102 sysdeps/win32/errno.cpp \
Josh Gaof551ea02016-07-28 18:09:48 -0700103 sysdeps/win32/stat.cpp \
Josh Gao456e1ad2017-01-19 13:44:23 -0800104 client/usb_windows.cpp \
Dan Albert94493762014-11-25 11:00:56 -0800105
Spencer Lowe6ae5732015-09-08 17:13:04 -0700106LIBADB_TEST_windows_SRCS := \
Josh Gaoa3577e12016-12-05 13:24:48 -0800107 sysdeps/win32/errno_test.cpp \
Spencer Lowe6ae5732015-09-08 17:13:04 -0700108 sysdeps_win32_test.cpp \
109
Dan Albert94493762014-11-25 11:00:56 -0800110include $(CLEAR_VARS)
Josh Gao44c688c2017-01-11 17:37:35 -0800111LOCAL_MODULE := libadbd_usb
Dan Albert94493762014-11-25 11:00:56 -0800112LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
Josh Gao44c688c2017-01-11 17:37:35 -0800113LOCAL_SRC_FILES := daemon/usb.cpp
Dan Albert21c3eaf2015-02-18 17:20:44 -0800114
Dan Albert9113b472015-07-30 10:25:32 -0700115LOCAL_SANITIZE := $(adb_target_sanitize)
Elliott Hughes7b506092015-04-20 08:09:20 -0700116
Dan Alberte2462192015-03-19 13:25:27 -0700117# Even though we're building a static library (and thus there's no link step for
118# this to take effect), this adds the includes to our path.
Josh Gao47763c32016-08-05 15:47:57 -0700119LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase
Dan Alberte2462192015-03-19 13:25:27 -0700120
Dan Albert94493762014-11-25 11:00:56 -0800121include $(BUILD_STATIC_LIBRARY)
122
Dan Albert630b9af2014-11-24 23:34:35 -0800123include $(CLEAR_VARS)
Josh Gao44c688c2017-01-11 17:37:35 -0800124LOCAL_MODULE := libadbd
125LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
126LOCAL_SRC_FILES := \
127 $(LIBADB_SRC_FILES) \
128 adbd_auth.cpp \
129 jdwp_service.cpp \
Josh Gao46de1d72017-04-12 13:57:06 -0700130 sysdeps/posix/network.cpp \
Josh Gao44c688c2017-01-11 17:37:35 -0800131
132LOCAL_SANITIZE := $(adb_target_sanitize)
133
134# Even though we're building a static library (and thus there's no link step for
135# this to take effect), this adds the includes to our path.
136LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase
137
138LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb
139
140include $(BUILD_STATIC_LIBRARY)
141
142include $(CLEAR_VARS)
Dan Albert630b9af2014-11-24 23:34:35 -0800143LOCAL_MODULE := libadb
Dan Willemsen87a419c2015-08-13 14:43:34 -0700144LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albert94493762014-11-25 11:00:56 -0800145LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1
Dan Willemsen87a419c2015-08-13 14:43:34 -0700146LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS)
147LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS)
Josh Gaob7b1edf2015-11-11 17:56:12 -0800148LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS)
Dan Alberte1ca6232015-02-19 13:19:42 -0800149LOCAL_SRC_FILES := \
150 $(LIBADB_SRC_FILES) \
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700151 adb_auth_host.cpp \
152 transport_mdns.cpp \
Dan Albert630b9af2014-11-24 23:34:35 -0800153
Dan Willemsen87a419c2015-08-13 14:43:34 -0700154LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES)
155LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES)
156LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES)
157
Dan Albert9113b472015-07-30 10:25:32 -0700158LOCAL_SANITIZE := $(adb_host_sanitize)
Elliott Hughes7b506092015-04-20 08:09:20 -0700159
Dan Alberte1ca6232015-02-19 13:19:42 -0800160# Even though we're building a static library (and thus there's no link step for
Dan Alberte2462192015-03-19 13:25:27 -0700161# this to take effect), this adds the includes to our path.
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700162LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd
163LOCAL_STATIC_LIBRARIES_linux := libusb
Josh Gao1c70e1b2016-09-28 12:32:45 -0700164LOCAL_STATIC_LIBRARIES_darwin := libusb
Dan Alberte1ca6232015-02-19 13:19:42 -0800165
Dan Willemsen87a419c2015-08-13 14:43:34 -0700166LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/
Dan Willemsen66680c52015-09-03 20:29:56 -0700167LOCAL_MULTILIB := first
Dan Albert88cf1c82015-02-24 14:08:03 -0800168
Dan Albert630b9af2014-11-24 23:34:35 -0800169include $(BUILD_HOST_STATIC_LIBRARY)
170
Dan Albert055f1aa2015-02-20 17:24:58 -0800171include $(CLEAR_VARS)
Dan Albert055f1aa2015-02-20 17:24:58 -0800172LOCAL_MODULE := adbd_test
173LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS)
Yabin Cuibec02fc2015-08-28 15:44:27 -0700174LOCAL_SRC_FILES := \
175 $(LIBADB_TEST_SRCS) \
176 $(LIBADB_TEST_linux_SRCS) \
David Pursell0955c662015-08-31 10:42:13 -0700177 shell_service.cpp \
David Pursellb9e2e842015-08-31 15:36:18 -0700178 shell_service_protocol.cpp \
179 shell_service_protocol_test.cpp \
David Pursell0955c662015-08-31 10:42:13 -0700180 shell_service_test.cpp \
Yabin Cuibec02fc2015-08-28 15:44:27 -0700181
Dan Albert9113b472015-07-30 10:25:32 -0700182LOCAL_SANITIZE := $(adb_target_sanitize)
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700183LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd
Dimitry Ivanov01f21da2016-02-12 18:40:29 -0800184LOCAL_SHARED_LIBRARIES := liblog libbase libcutils
Dan Albert055f1aa2015-02-20 17:24:58 -0800185include $(BUILD_NATIVE_TEST)
186
Elliott Hughes1b708d32015-12-11 19:07:01 -0800187# libdiagnose_usb
188# =========================================================
189
190include $(CLEAR_VARS)
191LOCAL_MODULE := libdiagnose_usb
192LOCAL_MODULE_HOST_OS := darwin linux windows
193LOCAL_CFLAGS := $(LIBADB_CFLAGS)
194LOCAL_SRC_FILES := diagnose_usb.cpp
195# Even though we're building a static library (and thus there's no link step for
196# this to take effect), this adds the includes to our path.
197LOCAL_STATIC_LIBRARIES := libbase
198include $(BUILD_HOST_STATIC_LIBRARY)
199
Spencer Lowcf168a82015-05-24 15:36:28 -0700200# adb_test
201# =========================================================
202
Dan Albert055f1aa2015-02-20 17:24:58 -0800203include $(CLEAR_VARS)
Dan Albert055f1aa2015-02-20 17:24:58 -0800204LOCAL_MODULE := adb_test
Spencer Lowebf770f2015-09-07 23:39:02 -0700205LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Albert055f1aa2015-02-20 17:24:58 -0800206LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS)
Dan Willemsen87a419c2015-08-13 14:43:34 -0700207LOCAL_CFLAGS_windows := $(LIBADB_windows_CFLAGS)
208LOCAL_CFLAGS_linux := $(LIBADB_linux_CFLAGS)
Josh Gaob7b1edf2015-11-11 17:56:12 -0800209LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS)
David Pursellb9e2e842015-08-31 15:36:18 -0700210LOCAL_SRC_FILES := \
211 $(LIBADB_TEST_SRCS) \
Felipe Leme698e0652016-07-19 17:07:22 -0700212 adb_client.cpp \
213 bugreport.cpp \
214 bugreport_test.cpp \
Felipe Leme6f5080f2016-07-26 12:23:40 -0700215 line_printer.cpp \
David Pursellb9e2e842015-08-31 15:36:18 -0700216 services.cpp \
217 shell_service_protocol.cpp \
218 shell_service_protocol_test.cpp \
219
David Pursellb404dec2015-09-11 16:06:59 -0700220LOCAL_SRC_FILES_linux := $(LIBADB_TEST_linux_SRCS)
Dan Willemsen87a419c2015-08-13 14:43:34 -0700221LOCAL_SRC_FILES_darwin := $(LIBADB_TEST_darwin_SRCS)
Spencer Lowe6ae5732015-09-08 17:13:04 -0700222LOCAL_SRC_FILES_windows := $(LIBADB_TEST_windows_SRCS)
Dan Albert9113b472015-07-30 10:25:32 -0700223LOCAL_SANITIZE := $(adb_host_sanitize)
Dan Albert055f1aa2015-02-20 17:24:58 -0800224LOCAL_STATIC_LIBRARIES := \
225 libadb \
Josh Gao47330e22017-04-12 17:04:41 -0700226 libbase \
Josh Gao47763c32016-08-05 15:47:57 -0700227 libcrypto_utils \
228 libcrypto \
Dan Albert055f1aa2015-02-20 17:24:58 -0800229 libcutils \
Elliott Hughes1b708d32015-12-11 19:07:01 -0800230 libdiagnose_usb \
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700231 libmdnssd \
Elliott Hughes8964fbf2017-05-10 08:41:33 -0700232 libgmock_host \
Dan Albert055f1aa2015-02-20 17:24:58 -0800233
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700234LOCAL_STATIC_LIBRARIES_linux := libusb
Josh Gao1c70e1b2016-09-28 12:32:45 -0700235LOCAL_STATIC_LIBRARIES_darwin := libusb
236
Spencer Lowe6ae5732015-09-08 17:13:04 -0700237# Set entrypoint to wmain from sysdeps_win32.cpp instead of main
238LOCAL_LDFLAGS_windows := -municode
Dan Willemsen87a419c2015-08-13 14:43:34 -0700239LOCAL_LDLIBS_linux := -lrt -ldl -lpthread
Josh Gao1c70e1b2016-09-28 12:32:45 -0700240LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc
Josh Gao3d4d9732017-02-23 13:16:52 -0800241LOCAL_LDLIBS_windows := -lws2_32 -luserenv
Dan Willemsen87a419c2015-08-13 14:43:34 -0700242LOCAL_STATIC_LIBRARIES_windows := AdbWinApi
Dan Albert055f1aa2015-02-20 17:24:58 -0800243
Dan Willemsen1e20e0a2015-12-21 16:14:31 -0800244LOCAL_MULTILIB := first
245
Spencer Lowcf168a82015-05-24 15:36:28 -0700246include $(BUILD_HOST_NATIVE_TEST)
247
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800248# adb host tool
249# =========================================================
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800250include $(CLEAR_VARS)
251
Dan Willemsen87a419c2015-08-13 14:43:34 -0700252LOCAL_LDLIBS_linux := -lrt -ldl -lpthread
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800253
Josh Gao1c70e1b2016-09-28 12:32:45 -0700254LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon -lobjc
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800255
Dan Willemsen87a419c2015-08-13 14:43:34 -0700256# Use wmain instead of main
257LOCAL_LDFLAGS_windows := -municode
Josh Gao3d4d9732017-02-23 13:16:52 -0800258LOCAL_LDLIBS_windows := -lws2_32 -lgdi32
Dan Willemsen87a419c2015-08-13 14:43:34 -0700259LOCAL_STATIC_LIBRARIES_windows := AdbWinApi
260LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi
Dan Albert9697ce52015-02-20 17:28:44 -0800261
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800262LOCAL_SRC_FILES := \
Elliott Hughesb708d162015-10-27 16:03:15 -0700263 adb_client.cpp \
Felipe Leme698e0652016-07-19 17:07:22 -0700264 bugreport.cpp \
Dan Albertc89e0cc2015-05-08 16:13:53 -0700265 client/main.cpp \
Dan Albertbac34742015-02-25 17:51:28 -0800266 console.cpp \
267 commandline.cpp \
Dan Albertbac34742015-02-25 17:51:28 -0800268 file_sync_client.cpp \
Elliott Hughesb708d162015-10-27 16:03:15 -0700269 line_printer.cpp \
270 services.cpp \
David Pursellb9e2e842015-08-31 15:36:18 -0700271 shell_service_protocol.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800272
Dan Albert7fd821e2015-02-24 22:38:21 -0800273LOCAL_CFLAGS += \
Dan Albert1ba1d7c2015-05-05 17:46:50 -0700274 $(ADB_COMMON_CFLAGS) \
Dan Albert7fd821e2015-02-24 22:38:21 -0800275 -D_GNU_SOURCE \
276 -DADB_HOST=1 \
277
Dan Willemsen87a419c2015-08-13 14:43:34 -0700278LOCAL_CFLAGS_windows := \
279 $(ADB_COMMON_windows_CFLAGS)
280
Josh Gaob7b1edf2015-11-11 17:56:12 -0800281LOCAL_CFLAGS_linux := \
282 $(ADB_COMMON_linux_CFLAGS) \
283
284LOCAL_CFLAGS_darwin := \
285 $(ADB_COMMON_darwin_CFLAGS) \
286 -Wno-sizeof-pointer-memaccess -Wno-unused-parameter \
287
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800288LOCAL_MODULE := adb
Kenny Rootd5d6d972012-09-26 09:58:07 -0700289LOCAL_MODULE_TAGS := debug
Dan Willemsen87a419c2015-08-13 14:43:34 -0700290LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800291
Dan Albert9113b472015-07-30 10:25:32 -0700292LOCAL_SANITIZE := $(adb_host_sanitize)
Dan Albert630b9af2014-11-24 23:34:35 -0800293LOCAL_STATIC_LIBRARIES := \
294 libadb \
Elliott Hughes2baae3a2015-04-17 10:59:34 -0700295 libbase \
Josh Gao47763c32016-08-05 15:47:57 -0700296 libcrypto_utils \
297 libcrypto \
Elliott Hughes1b708d32015-12-11 19:07:01 -0800298 libdiagnose_usb \
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700299 liblog \
Elliott Hughes8964fbf2017-05-10 08:41:33 -0700300 libmdnssd \
Dan Albert630b9af2014-11-24 23:34:35 -0800301
Josh Gaoa629e2e2015-11-13 17:55:45 -0800302# Don't use libcutils on Windows.
303LOCAL_STATIC_LIBRARIES_darwin := libcutils
Casey Dahlin2fe9b602016-09-21 14:03:39 -0700304LOCAL_STATIC_LIBRARIES_linux := libcutils
Josh Gaoa629e2e2015-11-13 17:55:45 -0800305
Josh Gao1c70e1b2016-09-28 12:32:45 -0700306LOCAL_STATIC_LIBRARIES_darwin += libusb
307LOCAL_STATIC_LIBRARIES_linux += libusb
308
Dan Willemsen87a419c2015-08-13 14:43:34 -0700309LOCAL_CXX_STL := libc++_static
Colin Cross55bf5f02015-04-16 16:21:44 -0700310
311# Don't add anything here, we don't want additional shared dependencies
312# on the host adb tool, and shared libraries that link against libc++
313# will violate ODR
314LOCAL_SHARED_LIBRARIES :=
315
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800316include $(BUILD_HOST_EXECUTABLE)
317
Ying Wang71edfc82016-02-29 19:27:06 -0800318$(call dist-for-goals,dist_files sdk win_sdk,$(LOCAL_BUILT_MODULE))
319ifdef HOST_CROSS_OS
320# Archive adb.exe for win_sdk build.
321$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_adb.BUILT))
322endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800323
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800324
325# adbd device daemon
326# =========================================================
327
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800328include $(CLEAR_VARS)
329
330LOCAL_SRC_FILES := \
Dan Albertc89e0cc2015-05-08 16:13:53 -0700331 daemon/main.cpp \
Casey Dahlin6cd5e0b2016-05-06 16:19:13 -0700332 daemon/mdns.cpp \
Dan Albertbac34742015-02-25 17:51:28 -0800333 services.cpp \
334 file_sync_service.cpp \
335 framebuffer_service.cpp \
336 remount_service.cpp \
337 set_verity_enable_state_service.cpp \
David Pursell80f67022015-08-28 15:08:49 -0700338 shell_service.cpp \
David Pursellb9e2e842015-08-31 15:36:18 -0700339 shell_service_protocol.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800340
Christopher Ferris51448eb2014-09-03 19:48:48 -0700341LOCAL_CFLAGS := \
Dan Albert1ba1d7c2015-05-05 17:46:50 -0700342 $(ADB_COMMON_CFLAGS) \
Josh Gaob7b1edf2015-11-11 17:56:12 -0800343 $(ADB_COMMON_linux_CFLAGS) \
Dan Albertbac34742015-02-25 17:51:28 -0800344 -DADB_HOST=0 \
345 -D_GNU_SOURCE \
Dan Albertbac34742015-02-25 17:51:28 -0800346 -Wno-deprecated-declarations \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800347
Elliott Hughes5cba5042015-06-17 15:23:42 -0700348LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
Nick Kralevich5890fe32012-01-19 13:11:35 -0800349
Elliott Hughesec7a6672015-03-16 21:58:32 +0000350ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Paul Lawrenceec900bb2014-10-09 14:22:49 +0000351LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
Bowgo Tsai0603ec42017-08-31 06:26:47 +0000352LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
Paul Lawrenceec900bb2014-10-09 14:22:49 +0000353endif
354
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800355LOCAL_MODULE := adbd
356
357LOCAL_FORCE_STATIC_EXECUTABLE := true
358LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
359LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
360
Dan Albert9113b472015-07-30 10:25:32 -0700361LOCAL_SANITIZE := $(adb_target_sanitize)
Josh Gao809607a2016-06-15 18:33:11 -0700362LOCAL_STRIP_MODULE := keep_symbols
Dan Albert630b9af2014-11-24 23:34:35 -0800363LOCAL_STATIC_LIBRARIES := \
Dan Albert94493762014-11-25 11:00:56 -0800364 libadbd \
David Zeuthen1e033d62017-04-12 16:07:06 -0400365 libavb_user \
Tao Bao175b7bb2015-03-29 11:22:34 -0700366 libbase \
Tao Bao40e0ec92017-01-05 18:01:01 -0800367 libbootloader_message \
Dan Albert030b76f2015-01-26 17:13:54 -0800368 libfs_mgr \
Sami Tolvanen8ad80762015-10-20 13:24:24 +0100369 libfec \
370 libfec_rs \
William Robertsbd2d9612015-08-04 14:23:04 -0700371 libselinux \
Dan Albert630b9af2014-11-24 23:34:35 -0800372 liblog \
Alex Deymo705353a2017-01-11 14:03:11 -0800373 libext4_utils \
Sami Tolvanen8ad80762015-10-20 13:24:24 +0100374 libsquashfs_utils \
Dan Alberte2462192015-03-19 13:25:27 -0700375 libcutils \
376 libbase \
Josh Gao47763c32016-08-05 15:47:57 -0700377 libcrypto_utils \
378 libcrypto \
Josh Gao809607a2016-06-15 18:33:11 -0700379 libminijail \
Casey Dahlin6cd5e0b2016-05-06 16:19:13 -0700380 libmdnssd \
Josh Gaocbe70cb2016-10-18 18:17:52 -0700381 libdebuggerd_handler \
Paul Lawrenceec900bb2014-10-09 14:22:49 +0000382
Jeff Brown29e1e732011-07-11 22:12:32 -0700383include $(BUILD_EXECUTABLE)
Josh Gao44c688c2017-01-11 17:37:35 -0800384
GuangHui Liu41bda342017-05-10 14:37:17 -0700385# adb integration test
386# =========================================================
387$(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_adb.BUILT))
388$(call dist-for-goals,sdk,$(ALL_MODULES.adb_integration_test_device.BUILT))
389
Josh Gao44c688c2017-01-11 17:37:35 -0800390include $(call first-makefiles-under,$(LOCAL_PATH))