Move more into libadb and libadbd.
None of this needs to be shared with minadbd, but these sources are
still needed for anything linking libadb (such as tests).
Change-Id: I3024f714da42364bf27a991986f00676e2bbbf2c
diff --git a/adb/Android.mk b/adb/Android.mk
index e5bc539..fb7a3f3 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -20,6 +20,7 @@
adb_listeners.c \
sockets.c \
transport.c \
+ transport_local.c \
transport_usb.c \
LIBADB_CFLAGS := \
@@ -27,16 +28,17 @@
-D_XOPEN_SOURCE -D_GNU_SOURCE \
-fvisibility=hidden \
-LIBADB_LINUX_SRC_FILES := fdevent.cpp
-LIBADB_WINDOWS_SRC_FILES := sysdeps_win32.c
+LIBADB_darwin_SRC_FILES := get_my_path_darwin.c usb_osx.c
+LIBADB_linux_SRC_FILES := fdevent.cpp get_my_path_linux.c usb_linux.c
+LIBADB_windows_SRC_FILES := get_my_path_windows.c sysdeps_win32.c usb_windows.c
include $(CLEAR_VARS)
LOCAL_MODULE := libadbd
LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0
LOCAL_SRC_FILES := \
$(LIBADB_SRC_FILES) \
- $(LIBADB_LINUX_SRC_FILES) \
adb_auth_client.c \
+ fdevent.cpp \
jdwp_service.c \
qemu_tracing.c \
usb_linux_client.c \
@@ -48,44 +50,30 @@
LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1
LOCAL_SRC_FILES := \
$(LIBADB_SRC_FILES) \
+ $(LIBADB_$(HOST_OS)_SRC_FILES) \
adb_auth_host.c \
# 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
-ifeq ($(HOST_OS),windows)
- LOCAL_SRC_FILES += $(LIBADB_WINDOWS_SRC_FILES)
-else
- LOCAL_SRC_FILES += $(LIBADB_LINUX_SRC_FILES)
-endif
include $(BUILD_HOST_STATIC_LIBRARY)
# adb host tool
# =========================================================
include $(CLEAR_VARS)
-# Default to a virtual (sockets) usb interface
-USB_SRCS :=
-EXTRA_SRCS :=
-
ifeq ($(HOST_OS),linux)
- USB_SRCS := usb_linux.c
- EXTRA_SRCS := get_my_path_linux.c
LOCAL_LDLIBS += -lrt -ldl -lpthread
LOCAL_CFLAGS += -DWORKAROUND_BUG6558362
endif
ifeq ($(HOST_OS),darwin)
- USB_SRCS := usb_osx.c
- EXTRA_SRCS := get_my_path_darwin.c
LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter
endif
ifeq ($(HOST_OS),windows)
- USB_SRCS := usb_windows.c
- EXTRA_SRCS := get_my_path_windows.c
EXTRA_STATIC_LIBS := AdbWinApi
ifneq ($(strip $(USE_MINGW)),)
# MinGW under Linux case
@@ -98,13 +86,10 @@
LOCAL_SRC_FILES := \
adb_main.c \
console.c \
- transport_local.c \
commandline.c \
adb_client.c \
services.c \
file_sync_client.c \
- $(EXTRA_SRCS) \
- $(USB_SRCS) \
ifneq ($(USE_SYSDEPS_WIN32),)
LOCAL_SRC_FILES += sysdeps_win32.c
@@ -144,13 +129,11 @@
LOCAL_SRC_FILES := \
adb_main.c \
- transport_local.c \
services.c \
file_sync_service.c \
framebuffer_service.c \
remount_service.c \
set_verity_enable_state_service.c \
- usb_linux_client.c
LOCAL_CFLAGS := \
-O2 \