Build adb for target-as-host

Added a new target for adb, so that the adb
host executable is built for the target as
well. This allows the target to connect to
any Android devices which are attached to it.

Bug: 3022194
Change-Id: Ib01983e70b75cec40a9ee161da7f4cf1343eecf2
This commit is contained in:
John Michelau 2010-09-23 17:08:34 -05:00 committed by Benoit Goby
parent 597e46aff4
commit c318833b35
2 changed files with 49 additions and 1 deletions

View File

@ -152,3 +152,43 @@ else
endif
endif
# adb host tool for device-as-host
# =========================================================
include $(CLEAR_VARS)
LOCAL_LDLIBS := -lrt -lncurses -lpthread
LOCAL_SRC_FILES := \
adb.c \
console.c \
transport.c \
transport_local.c \
transport_usb.c \
commandline.c \
adb_client.c \
sockets.c \
services.c \
file_sync_client.c \
get_my_path_linux.c \
usb_linux.c \
utils.c \
usb_vendors.c \
fdevent.c
LOCAL_CFLAGS := \
-O2 \
-g \
-DADB_HOST=1 \
-DADB_HOST_ON_TARGET=1 \
-Wall \
-Wno-unused-parameter \
-D_XOPEN_SOURCE \
-D_GNU_SOURCE
LOCAL_MODULE := adb
LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils
include $(BUILD_EXECUTABLE)

View File

@ -366,7 +366,15 @@ typedef enum {
#define print_packet(tag,p) do {} while (0)
#endif
#define DEFAULT_ADB_PORT 5037
#if ADB_HOST_ON_TARGET
/* adb and adbd are coexisting on the target, so use 5038 for adb
* to avoid conflicting with adbd's usage of 5037
*/
# define DEFAULT_ADB_PORT 5038
#else
# define DEFAULT_ADB_PORT 5037
#endif
#define DEFAULT_ADB_LOCAL_TRANSPORT_PORT 5555
#define ADB_CLASS 0xff