The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # Copyright 2005 The Android Open Source Project |
| 2 | # |
| 3 | # Android.mk for adb |
| 4 | # |
| 5 | |
| 6 | LOCAL_PATH:= $(call my-dir) |
| 7 | |
| 8 | # adb host tool |
| 9 | # ========================================================= |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 10 | include $(CLEAR_VARS) |
| 11 | |
| 12 | # Default to a virtual (sockets) usb interface |
| 13 | USB_SRCS := |
| 14 | EXTRA_SRCS := |
| 15 | |
| 16 | ifeq ($(HOST_OS),linux) |
| 17 | USB_SRCS := usb_linux.c |
| 18 | EXTRA_SRCS := get_my_path_linux.c |
| 19 | LOCAL_LDLIBS += -lrt -lncurses -lpthread |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 20 | LOCAL_SHARED_LIBRARIES := libcrypto |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 21 | endif |
| 22 | |
| 23 | ifeq ($(HOST_OS),darwin) |
| 24 | USB_SRCS := usb_osx.c |
| 25 | EXTRA_SRCS := get_my_path_darwin.c |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 26 | LOCAL_LDLIBS += -lpthread -lcrypto -framework CoreFoundation -framework IOKit -framework Carbon |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | endif |
| 28 | |
Alexey Tarasov | 3b226f9 | 2009-10-25 01:37:37 +1100 | [diff] [blame] | 29 | ifeq ($(HOST_OS),freebsd) |
| 30 | USB_SRCS := usb_libusb.c |
| 31 | EXTRA_SRCS := get_my_path_freebsd.c |
| 32 | LOCAL_LDLIBS += -lpthread -lusb |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 33 | LOCAL_SHARED_LIBRARIES := libcrypto |
Alexey Tarasov | 3b226f9 | 2009-10-25 01:37:37 +1100 | [diff] [blame] | 34 | endif |
| 35 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 36 | ifeq ($(HOST_OS),windows) |
| 37 | USB_SRCS := usb_windows.c |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 38 | EXTRA_SRCS := get_my_path_windows.c ../libcutils/list.c |
| 39 | EXTRA_STATIC_LIBS := AdbWinApi libcrypto_static |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 | ifneq ($(strip $(USE_CYGWIN)),) |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 41 | # Pure cygwin case |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 42 | LOCAL_LDLIBS += -lpthread -lgdi32 |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 43 | LOCAL_C_INCLUDES += /usr/include/w32api/ddk |
| 44 | endif |
| 45 | ifneq ($(strip $(USE_MINGW)),) |
| 46 | # MinGW under Linux case |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 47 | LOCAL_LDLIBS += -lws2_32 -lgdi32 |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 48 | USE_SYSDEPS_WIN32 := 1 |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 49 | LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 50 | endif |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 51 | LOCAL_C_INCLUDES += development/host/windows/usb/api/ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 52 | endif |
| 53 | |
| 54 | LOCAL_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 Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 62 | adb_auth_host.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 63 | sockets.c \ |
| 64 | services.c \ |
| 65 | file_sync_client.c \ |
| 66 | $(EXTRA_SRCS) \ |
| 67 | $(USB_SRCS) \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 68 | utils.c \ |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 69 | usb_vendors.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 71 | LOCAL_C_INCLUDES += external/openssl/include |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 72 | |
| 73 | ifneq ($(USE_SYSDEPS_WIN32),) |
| 74 | LOCAL_SRC_FILES += sysdeps_win32.c |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 75 | else |
| 76 | LOCAL_SRC_FILES += fdevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 | endif |
| 78 | |
| 79 | LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter |
Jack Palevich | 7fe202f | 2010-05-25 14:49:57 +0800 | [diff] [blame] | 80 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 81 | LOCAL_MODULE := adb |
| 82 | |
| 83 | LOCAL_STATIC_LIBRARIES := libzipfile libunz $(EXTRA_STATIC_LIBS) |
| 84 | ifeq ($(USE_SYSDEPS_WIN32),) |
| 85 | LOCAL_STATIC_LIBRARIES += libcutils |
| 86 | endif |
| 87 | |
| 88 | include $(BUILD_HOST_EXECUTABLE) |
| 89 | |
Ying Wang | 1c061b9 | 2010-12-09 10:33:27 -0800 | [diff] [blame] | 90 | $(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE)) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 91 | |
| 92 | ifeq ($(HOST_OS),windows) |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 93 | $(LOCAL_INSTALLED_MODULE): \ |
| 94 | $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ |
| 95 | $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 96 | endif |
| 97 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 98 | |
| 99 | # adbd device daemon |
| 100 | # ========================================================= |
| 101 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 102 | include $(CLEAR_VARS) |
| 103 | |
| 104 | LOCAL_SRC_FILES := \ |
| 105 | adb.c \ |
Christopher Tate | d2f5415 | 2011-04-21 12:53:28 -0700 | [diff] [blame] | 106 | backup_service.c \ |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 107 | fdevent.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 108 | transport.c \ |
| 109 | transport_local.c \ |
| 110 | transport_usb.c \ |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 111 | adb_auth_client.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 112 | 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 \ |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame] | 120 | utils.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 121 | |
| 122 | LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter |
| 123 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE |
| 124 | |
Nick Kralevich | 5890fe3 | 2012-01-19 13:11:35 -0800 | [diff] [blame] | 125 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
| 126 | LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1 |
| 127 | endif |
| 128 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 129 | LOCAL_MODULE := adbd |
| 130 | |
| 131 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 132 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) |
| 133 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) |
| 134 | |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 135 | LOCAL_STATIC_LIBRARIES := libcutils libc libmincrypt |
Jeff Brown | 29e1e73 | 2011-07-11 22:12:32 -0700 | [diff] [blame] | 136 | include $(BUILD_EXECUTABLE) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 137 | |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 138 | |
| 139 | # adb host tool for device-as-host |
| 140 | # ========================================================= |
Benoit Goby | dff0237 | 2010-10-06 18:30:55 -0700 | [diff] [blame] | 141 | ifneq ($(SDK_ONLY),true) |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 142 | include $(CLEAR_VARS) |
| 143 | |
| 144 | LOCAL_LDLIBS := -lrt -lncurses -lpthread |
| 145 | |
| 146 | LOCAL_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 Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 154 | adb_auth_host.c \ |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 155 | 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 | |
| 164 | LOCAL_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 Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 174 | LOCAL_C_INCLUDES += external/openssl/include |
| 175 | |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 176 | LOCAL_MODULE := adb |
| 177 | |
| 178 | LOCAL_STATIC_LIBRARIES := libzipfile libunz libcutils |
| 179 | |
Benoit Goby | d5fcafa | 2012-04-12 12:23:49 -0700 | [diff] [blame] | 180 | LOCAL_SHARED_LIBRARIES := libcrypto |
| 181 | |
John Michelau | c318833 | 2010-09-23 17:08:34 -0500 | [diff] [blame] | 182 | include $(BUILD_EXECUTABLE) |
Benoit Goby | cb56b71 | 2010-10-06 17:11:59 -0700 | [diff] [blame] | 183 | endif |