summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJohn Michelau <john.michelau@motorola.com>2010-09-23 17:08:34 -0500
committerBenoit Goby <benoit@android.com>2010-10-05 16:08:19 -0700
commitc318833b359164f25d7a93f6395c0cad787bacd7 (patch)
tree86cdf86687ec346df447f85ef8643cce51bf9dfb /adb
parent597e46aff44d972a6ca2942107d292fe612d8912 (diff)
downloadsystem_core-c318833b359164f25d7a93f6395c0cad787bacd7.zip
system_core-c318833b359164f25d7a93f6395c0cad787bacd7.tar.gz
system_core-c318833b359164f25d7a93f6395c0cad787bacd7.tar.bz2
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
Diffstat (limited to 'adb')
-rw-r--r--adb/Android.mk40
-rw-r--r--adb/adb.h10
2 files changed, 49 insertions, 1 deletions
diff --git a/adb/Android.mk b/adb/Android.mk
index 7faca9b..a61dcde 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -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)
diff --git a/adb/adb.h b/adb/adb.h
index 3d2a77b..0aa98d3 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -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