2009-03-04 04:32:55 +01:00
|
|
|
# Copyright 2005 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Android.mk for adb
|
|
|
|
#
|
|
|
|
|
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
|
2015-04-19 22:17:01 +02:00
|
|
|
ifeq ($(HOST_OS),windows)
|
2015-05-05 23:50:09 +02:00
|
|
|
adb_host_clang := false # libc++ for mingw not ready yet.
|
2015-04-19 22:17:01 +02:00
|
|
|
else
|
2015-05-05 23:50:09 +02:00
|
|
|
adb_host_clang := true
|
2015-04-19 22:17:01 +02:00
|
|
|
endif
|
2015-02-21 02:28:44 +01:00
|
|
|
|
2015-05-06 02:46:50 +02:00
|
|
|
adb_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
|
|
|
|
|
|
|
|
ADB_COMMON_CFLAGS := \
|
|
|
|
-Wall -Werror \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-DADB_REVISION='"$(adb_version)"' \
|
|
|
|
|
2014-11-25 08:34:35 +01:00
|
|
|
# libadb
|
|
|
|
# =========================================================
|
|
|
|
|
|
|
|
# Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes
|
|
|
|
# made to adb rarely get ported to the other two, so the trees have diverged a
|
|
|
|
# bit. We'd like to stop this because it is a maintenance nightmare, but the
|
|
|
|
# divergence makes this difficult to do all at once. For now, we will start
|
|
|
|
# small by moving common files into a static library. Hopefully some day we can
|
|
|
|
# get enough of adb in here that we no longer need minadb. https://b/17626262
|
2015-02-19 02:47:33 +01:00
|
|
|
LIBADB_SRC_FILES := \
|
2015-02-26 02:51:28 +01:00
|
|
|
adb.cpp \
|
|
|
|
adb_auth.cpp \
|
2015-02-25 06:26:58 +01:00
|
|
|
adb_io.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
adb_listeners.cpp \
|
2015-04-17 22:57:15 +02:00
|
|
|
adb_utils.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
sockets.cpp \
|
|
|
|
transport.cpp \
|
|
|
|
transport_local.cpp \
|
|
|
|
transport_usb.cpp \
|
2015-02-19 02:47:33 +01:00
|
|
|
|
2015-04-19 22:17:01 +02:00
|
|
|
LIBADB_TEST_SRCS := \
|
|
|
|
adb_io_test.cpp \
|
|
|
|
adb_utils_test.cpp \
|
|
|
|
transport_test.cpp \
|
|
|
|
|
2015-02-21 02:20:09 +01:00
|
|
|
LIBADB_CFLAGS := \
|
2015-05-06 02:46:50 +02:00
|
|
|
$(ADB_COMMON_CFLAGS) \
|
2015-02-21 02:24:58 +01:00
|
|
|
-Wno-missing-field-initializers \
|
2015-02-19 02:47:33 +01:00
|
|
|
-fvisibility=hidden \
|
2014-11-25 08:34:35 +01:00
|
|
|
|
2015-02-26 02:51:28 +01:00
|
|
|
LIBADB_darwin_SRC_FILES := \
|
|
|
|
fdevent.cpp \
|
2015-04-16 22:24:58 +02:00
|
|
|
get_my_path_darwin.cpp \
|
2015-04-17 04:20:40 +02:00
|
|
|
usb_osx.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
|
|
|
|
LIBADB_linux_SRC_FILES := \
|
|
|
|
fdevent.cpp \
|
|
|
|
get_my_path_linux.cpp \
|
|
|
|
usb_linux.cpp \
|
|
|
|
|
|
|
|
LIBADB_windows_SRC_FILES := \
|
|
|
|
get_my_path_windows.cpp \
|
2015-04-17 01:47:02 +02:00
|
|
|
sysdeps_win32.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
usb_windows.cpp \
|
2014-11-25 20:00:56 +01:00
|
|
|
|
2014-11-25 08:34:35 +01:00
|
|
|
include $(CLEAR_VARS)
|
2015-04-16 23:12:50 +02:00
|
|
|
LOCAL_CLANG := true
|
2014-11-25 20:00:56 +01:00
|
|
|
LOCAL_MODULE := libadbd
|
2014-11-25 08:34:35 +01:00
|
|
|
LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
|
2015-02-19 02:20:44 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
$(LIBADB_SRC_FILES) \
|
2015-02-26 02:51:28 +01:00
|
|
|
adb_auth_client.cpp \
|
2015-02-21 02:24:30 +01:00
|
|
|
fdevent.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
jdwp_service.cpp \
|
|
|
|
qemu_tracing.cpp \
|
2015-04-16 23:12:50 +02:00
|
|
|
usb_linux_client.cpp \
|
2015-02-19 02:20:44 +01:00
|
|
|
|
2015-04-20 17:09:20 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := libbase
|
|
|
|
|
2014-11-25 20:00:56 +01:00
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
2015-04-19 22:17:01 +02:00
|
|
|
LOCAL_CLANG := $(adb_host_clang)
|
2014-11-25 20:00:56 +01:00
|
|
|
LOCAL_MODULE := libadb
|
|
|
|
LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1
|
2015-02-19 22:19:42 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
$(LIBADB_SRC_FILES) \
|
2015-02-21 02:24:30 +01:00
|
|
|
$(LIBADB_$(HOST_OS)_SRC_FILES) \
|
2015-02-26 02:51:28 +01:00
|
|
|
adb_auth_host.cpp \
|
2015-02-19 22:19:42 +01:00
|
|
|
|
2015-04-20 17:09:20 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := libbase
|
|
|
|
|
2015-02-19 22:19:42 +01:00
|
|
|
# Even though we're building a static library (and thus there's no link step for
|
|
|
|
# this to take effect), this adds the SSL includes to our path.
|
|
|
|
LOCAL_STATIC_LIBRARIES := libcrypto_static
|
2014-11-25 08:34:35 +01:00
|
|
|
|
2015-02-24 23:08:03 +01:00
|
|
|
ifeq ($(HOST_OS),windows)
|
|
|
|
LOCAL_C_INCLUDES += development/host/windows/usb/api/
|
|
|
|
endif
|
|
|
|
|
2014-11-25 08:34:35 +01:00
|
|
|
include $(BUILD_HOST_STATIC_LIBRARY)
|
|
|
|
|
2015-02-21 02:24:58 +01:00
|
|
|
include $(CLEAR_VARS)
|
2015-04-19 22:17:01 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-02-21 02:24:58 +01:00
|
|
|
LOCAL_MODULE := adbd_test
|
|
|
|
LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS)
|
|
|
|
LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS)
|
|
|
|
LOCAL_STATIC_LIBRARIES := libadbd
|
2015-03-16 18:08:46 +01:00
|
|
|
LOCAL_SHARED_LIBRARIES := liblog libbase libcutils
|
2015-02-21 02:24:58 +01:00
|
|
|
include $(BUILD_NATIVE_TEST)
|
|
|
|
|
2015-05-05 23:50:09 +02:00
|
|
|
ifneq ($(HOST_OS),windows)
|
2015-02-21 02:24:58 +01:00
|
|
|
include $(CLEAR_VARS)
|
2015-04-19 22:17:01 +02:00
|
|
|
LOCAL_CLANG := $(adb_host_clang)
|
2015-02-21 02:24:58 +01:00
|
|
|
LOCAL_MODULE := adb_test
|
|
|
|
LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS)
|
2015-02-26 02:51:28 +01:00
|
|
|
LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS) services.cpp
|
2015-03-16 18:08:46 +01:00
|
|
|
LOCAL_SHARED_LIBRARIES := liblog libbase
|
2015-02-21 02:24:58 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
|
|
|
libadb \
|
|
|
|
libcrypto_static \
|
|
|
|
libcutils \
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),linux)
|
2015-05-05 23:50:09 +02:00
|
|
|
LOCAL_LDLIBS += -lrt -ldl -lpthread
|
2015-02-21 02:24:58 +01:00
|
|
|
endif
|
|
|
|
|
2015-04-17 04:13:58 +02:00
|
|
|
ifeq ($(HOST_OS),darwin)
|
2015-05-05 23:50:09 +02:00
|
|
|
LOCAL_LDLIBS += -framework CoreFoundation -framework IOKit
|
2015-04-17 04:13:58 +02:00
|
|
|
endif
|
|
|
|
|
2015-02-21 02:24:58 +01:00
|
|
|
include $(BUILD_HOST_NATIVE_TEST)
|
2015-05-05 23:50:09 +02:00
|
|
|
endif
|
2015-02-21 02:24:58 +01:00
|
|
|
|
2015-05-01 02:32:03 +02:00
|
|
|
# adb device tracker (used by ddms) test tool
|
|
|
|
# =========================================================
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_CLANG := $(adb_host_clang)
|
|
|
|
LOCAL_MODULE := adb_device_tracker_test
|
|
|
|
LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS)
|
|
|
|
LOCAL_SRC_FILES := test_track_devices.cpp
|
|
|
|
LOCAL_SHARED_LIBRARIES := liblog libbase
|
|
|
|
LOCAL_STATIC_LIBRARIES := libadb libcrypto_static libcutils
|
|
|
|
LOCAL_LDLIBS += -lrt -ldl -lpthread
|
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
# adb host tool
|
|
|
|
# =========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),linux)
|
2015-05-07 01:13:42 +02:00
|
|
|
LOCAL_LDLIBS += -lrt -ldl -lpthread
|
|
|
|
LOCAL_CFLAGS += -DWORKAROUND_BUG6558362
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),darwin)
|
2015-05-07 01:13:42 +02:00
|
|
|
LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
|
|
|
|
LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),windows)
|
2015-05-07 01:13:42 +02:00
|
|
|
LOCAL_LDLIBS += -lws2_32 -lgdi32
|
|
|
|
EXTRA_STATIC_LIBS := AdbWinApi
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
2015-04-19 22:17:01 +02:00
|
|
|
LOCAL_CLANG := $(adb_host_clang)
|
2015-02-21 02:28:44 +01:00
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
2015-05-09 01:13:53 +02:00
|
|
|
client/main.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
console.cpp \
|
|
|
|
commandline.cpp \
|
|
|
|
adb_client.cpp \
|
|
|
|
services.cpp \
|
|
|
|
file_sync_client.cpp \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2015-02-25 07:38:21 +01:00
|
|
|
LOCAL_CFLAGS += \
|
2015-05-06 02:46:50 +02:00
|
|
|
$(ADB_COMMON_CFLAGS) \
|
2015-02-25 07:38:21 +01:00
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-DADB_HOST=1 \
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := adb
|
2012-09-26 18:58:07 +02:00
|
|
|
LOCAL_MODULE_TAGS := debug
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-11-25 08:34:35 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
|
|
|
libadb \
|
2015-04-17 19:59:34 +02:00
|
|
|
libbase \
|
2014-11-25 08:34:35 +01:00
|
|
|
libcrypto_static \
|
2015-04-19 22:17:01 +02:00
|
|
|
libcutils \
|
2015-04-27 23:20:17 +02:00
|
|
|
liblog \
|
2014-11-25 08:34:35 +01:00
|
|
|
$(EXTRA_STATIC_LIBS) \
|
|
|
|
|
2015-04-20 21:36:50 +02:00
|
|
|
# libc++ not available on windows yet
|
|
|
|
ifneq ($(HOST_OS),windows)
|
|
|
|
LOCAL_CXX_STL := libc++_static
|
|
|
|
endif
|
2015-04-17 01:21:44 +02:00
|
|
|
|
|
|
|
# Don't add anything here, we don't want additional shared dependencies
|
|
|
|
# on the host adb tool, and shared libraries that link against libc++
|
|
|
|
# will violate ODR
|
|
|
|
LOCAL_SHARED_LIBRARIES :=
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
|
|
|
|
2012-09-05 19:26:43 +02:00
|
|
|
$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
|
2009-03-04 04:32:55 +01:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),windows)
|
2009-08-11 20:08:45 +02:00
|
|
|
$(LOCAL_INSTALLED_MODULE): \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
# adbd device daemon
|
|
|
|
# =========================================================
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-04-19 22:17:01 +02:00
|
|
|
LOCAL_CLANG := true
|
2015-02-21 02:28:44 +01:00
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
2015-05-09 01:13:53 +02:00
|
|
|
daemon/main.cpp \
|
2015-02-26 02:51:28 +01:00
|
|
|
services.cpp \
|
|
|
|
file_sync_service.cpp \
|
|
|
|
framebuffer_service.cpp \
|
|
|
|
remount_service.cpp \
|
|
|
|
set_verity_enable_state_service.cpp \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-09-04 04:48:48 +02:00
|
|
|
LOCAL_CFLAGS := \
|
2015-05-06 02:46:50 +02:00
|
|
|
$(ADB_COMMON_CFLAGS) \
|
2015-02-26 02:51:28 +01:00
|
|
|
-DADB_HOST=0 \
|
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-Wno-deprecated-declarations \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2012-01-19 22:11:35 +01:00
|
|
|
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
|
|
|
|
LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
|
|
|
|
endif
|
|
|
|
|
2015-03-16 22:58:32 +01:00
|
|
|
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
|
2014-10-09 16:22:49 +02:00
|
|
|
LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := adbd
|
|
|
|
|
|
|
|
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
|
|
|
|
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
|
2015-03-29 20:22:34 +02:00
|
|
|
LOCAL_C_INCLUDES += system/extras/ext4_utils
|
2014-10-09 16:22:49 +02:00
|
|
|
|
2014-11-25 08:34:35 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
2014-11-25 20:00:56 +01:00
|
|
|
libadbd \
|
2015-03-29 20:22:34 +02:00
|
|
|
libbase \
|
2015-01-27 02:13:54 +01:00
|
|
|
libfs_mgr \
|
2014-11-25 08:34:35 +01:00
|
|
|
liblog \
|
|
|
|
libcutils \
|
|
|
|
libc \
|
|
|
|
libmincrypt \
|
|
|
|
libselinux \
|
2015-01-27 02:13:54 +01:00
|
|
|
libext4_utils_static \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2011-07-12 07:12:32 +02:00
|
|
|
include $(BUILD_EXECUTABLE)
|