blob: 681c7c730b864c8eeada0e6b267dc074dddf5117 [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
8# adb host tool
9# =========================================================
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080010include $(CLEAR_VARS)
11
12# Default to a virtual (sockets) usb interface
13USB_SRCS :=
14EXTRA_SRCS :=
15
16ifeq ($(HOST_OS),linux)
17 USB_SRCS := usb_linux.c
18 EXTRA_SRCS := get_my_path_linux.c
19 LOCAL_LDLIBS += -lrt -lncurses -lpthread
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070020 LOCAL_SHARED_LIBRARIES := libcrypto
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080021endif
22
23ifeq ($(HOST_OS),darwin)
24 USB_SRCS := usb_osx.c
25 EXTRA_SRCS := get_my_path_darwin.c
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070026 LOCAL_LDLIBS += -lpthread -lcrypto -framework CoreFoundation -framework IOKit -framework Carbon
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027endif
28
Alexey Tarasov3b226f92009-10-25 01:37:37 +110029ifeq ($(HOST_OS),freebsd)
30 USB_SRCS := usb_libusb.c
31 EXTRA_SRCS := get_my_path_freebsd.c
32 LOCAL_LDLIBS += -lpthread -lusb
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070033 LOCAL_SHARED_LIBRARIES := libcrypto
Alexey Tarasov3b226f92009-10-25 01:37:37 +110034endif
35
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080036ifeq ($(HOST_OS),windows)
37 USB_SRCS := usb_windows.c
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070038 EXTRA_SRCS := get_my_path_windows.c ../libcutils/list.c
39 EXTRA_STATIC_LIBS := AdbWinApi libcrypto_static
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080040 ifneq ($(strip $(USE_CYGWIN)),)
Raphaelfab16782010-04-13 15:25:50 -070041 # Pure cygwin case
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070042 LOCAL_LDLIBS += -lpthread -lgdi32
Raphaelfab16782010-04-13 15:25:50 -070043 LOCAL_C_INCLUDES += /usr/include/w32api/ddk
44 endif
45 ifneq ($(strip $(USE_MINGW)),)
46 # MinGW under Linux case
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070047 LOCAL_LDLIBS += -lws2_32 -lgdi32
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048 USE_SYSDEPS_WIN32 := 1
Raphaelfab16782010-04-13 15:25:50 -070049 LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050 endif
Raphaelfab16782010-04-13 15:25:50 -070051 LOCAL_C_INCLUDES += development/host/windows/usb/api/
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080052endif
53
54LOCAL_SRC_FILES := \
55 adb.c \
56 console.c \
57 transport.c \
58 transport_local.c \
59 transport_usb.c \
60 commandline.c \
61 adb_client.c \
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070062 adb_auth_host.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080063 sockets.c \
64 services.c \
65 file_sync_client.c \
66 $(EXTRA_SRCS) \
67 $(USB_SRCS) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080068 utils.c \
Raphael26f3de62009-08-11 11:08:45 -070069 usb_vendors.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080070
Benoit Gobyd5fcafa2012-04-12 12:23:49 -070071LOCAL_C_INCLUDES += external/openssl/include
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080072
73ifneq ($(USE_SYSDEPS_WIN32),)
74 LOCAL_SRC_FILES += sysdeps_win32.c
David 'Digit' Turner414ff7d2009-05-18 17:07:46 +020075else
76 LOCAL_SRC_FILES += fdevent.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077endif
78
79LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter
Jack Palevich7fe202f2010-05-25 14:49:57 +080080LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081LOCAL_MODULE := adb
82
83LOCAL_STATIC_LIBRARIES := libzipfile libunz $(EXTRA_STATIC_LIBS)
84ifeq ($(USE_SYSDEPS_WIN32),)
85 LOCAL_STATIC_LIBRARIES += libcutils
86endif
87
88include $(BUILD_HOST_EXECUTABLE)
89
Ying Wang1c061b92010-12-09 10:33:27 -080090$(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE))
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080091
92ifeq ($(HOST_OS),windows)
Raphael26f3de62009-08-11 11:08:45 -070093$(LOCAL_INSTALLED_MODULE): \
94 $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \
95 $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080096endif
97
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080098
99# adbd device daemon
100# =========================================================
101
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800102include $(CLEAR_VARS)
103
104LOCAL_SRC_FILES := \
105 adb.c \
Christopher Tated2f54152011-04-21 12:53:28 -0700106 backup_service.c \
David 'Digit' Turner414ff7d2009-05-18 17:07:46 +0200107 fdevent.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800108 transport.c \
109 transport_local.c \
110 transport_usb.c \
Benoit Gobyd5fcafa2012-04-12 12:23:49 -0700111 adb_auth_client.c \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800112 sockets.c \
113 services.c \
114 file_sync_service.c \
115 jdwp_service.c \
116 framebuffer_service.c \
117 remount_service.c \
118 usb_linux_client.c \
119 log_service.c \
Raphael26f3de62009-08-11 11:08:45 -0700120 utils.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800121
122LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
123LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
124
Nick Kralevich5890fe32012-01-19 13:11:35 -0800125ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
126LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
127endif
128
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800129LOCAL_MODULE := adbd
130
131LOCAL_FORCE_STATIC_EXECUTABLE := true
132LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
133LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
134
Benoit Gobyd5fcafa2012-04-12 12:23:49 -0700135LOCAL_STATIC_LIBRARIES := libcutils libc libmincrypt
Jeff Brown29e1e732011-07-11 22:12:32 -0700136include $(BUILD_EXECUTABLE)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800137
John Michelauc3188332010-09-23 17:08:34 -0500138
139# adb host tool for device-as-host
140# =========================================================
Benoit Gobydff02372010-10-06 18:30:55 -0700141ifneq ($(SDK_ONLY),true)
John Michelauc3188332010-09-23 17:08:34 -0500142include $(CLEAR_VARS)
143
144LOCAL_LDLIBS := -lrt -lncurses -lpthread
145
146LOCAL_SRC_FILES := \
147 adb.c \
148 console.c \
149 transport.c \
150 transport_local.c \
151 transport_usb.c \
152 commandline.c \
153 adb_client.c \
Benoit Gobyd5fcafa2012-04-12 12:23:49 -0700154 adb_auth_host.c \
John Michelauc3188332010-09-23 17:08:34 -0500155 sockets.c \
156 services.c \
157 file_sync_client.c \
158 get_my_path_linux.c \
159 usb_linux.c \
160 utils.c \
161 usb_vendors.c \
162 fdevent.c
163
164LOCAL_CFLAGS := \
165 -O2 \
166 -g \
167 -DADB_HOST=1 \
168 -DADB_HOST_ON_TARGET=1 \
169 -Wall \
170 -Wno-unused-parameter \
171 -D_XOPEN_SOURCE \
172 -D_GNU_SOURCE
173
Benoit Gobyd5fcafa2012-04-12 12:23:49 -0700174LOCAL_C_INCLUDES += external/openssl/include
175
John Michelauc3188332010-09-23 17:08:34 -0500176LOCAL_MODULE := adb
177
178LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils
179
Benoit Gobyd5fcafa2012-04-12 12:23:49 -0700180LOCAL_SHARED_LIBRARIES := libcrypto
181
John Michelauc3188332010-09-23 17:08:34 -0500182include $(BUILD_EXECUTABLE)
Benoit Gobycb56b712010-10-06 17:11:59 -0700183endif