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 |
| 20 | endif |
| 21 | |
| 22 | ifeq ($(HOST_OS),darwin) |
| 23 | USB_SRCS := usb_osx.c |
| 24 | EXTRA_SRCS := get_my_path_darwin.c |
| 25 | LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon |
| 26 | endif |
| 27 | |
| 28 | ifeq ($(HOST_OS),windows) |
| 29 | USB_SRCS := usb_windows.c |
| 30 | EXTRA_SRCS := get_my_path_windows.c |
| 31 | EXTRA_STATIC_LIBS := AdbWinApi |
| 32 | LOCAL_C_INCLUDES += /usr/include/w32api/ddk development/host/windows/usb/api/ |
| 33 | ifneq ($(strip $(USE_CYGWIN)),) |
| 34 | LOCAL_LDLIBS += -lpthread |
| 35 | else |
| 36 | LOCAL_LDLIBS += -lws2_32 |
| 37 | USE_SYSDEPS_WIN32 := 1 |
| 38 | endif |
| 39 | endif |
| 40 | |
| 41 | LOCAL_SRC_FILES := \ |
| 42 | adb.c \ |
| 43 | console.c \ |
| 44 | transport.c \ |
| 45 | transport_local.c \ |
| 46 | transport_usb.c \ |
| 47 | commandline.c \ |
| 48 | adb_client.c \ |
| 49 | sockets.c \ |
| 50 | services.c \ |
| 51 | file_sync_client.c \ |
| 52 | $(EXTRA_SRCS) \ |
| 53 | $(USB_SRCS) \ |
| 54 | shlist.c \ |
| 55 | utils.c \ |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame^] | 56 | usb_vendors.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 57 | |
| 58 | |
| 59 | ifneq ($(USE_SYSDEPS_WIN32),) |
| 60 | LOCAL_SRC_FILES += sysdeps_win32.c |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 61 | else |
| 62 | LOCAL_SRC_FILES += fdevent.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 63 | endif |
| 64 | |
| 65 | LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter |
| 66 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -DSH_HISTORY |
| 67 | LOCAL_MODULE := adb |
| 68 | |
| 69 | LOCAL_STATIC_LIBRARIES := libzipfile libunz $(EXTRA_STATIC_LIBS) |
| 70 | ifeq ($(USE_SYSDEPS_WIN32),) |
| 71 | LOCAL_STATIC_LIBRARIES += libcutils |
| 72 | endif |
| 73 | |
| 74 | include $(BUILD_HOST_EXECUTABLE) |
| 75 | |
| 76 | $(call dist-for-goals,droid,$(LOCAL_BUILT_MODULE)) |
| 77 | |
| 78 | ifeq ($(HOST_OS),windows) |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame^] | 79 | $(LOCAL_INSTALLED_MODULE): \ |
| 80 | $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \ |
| 81 | $(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 82 | endif |
| 83 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 84 | |
| 85 | # adbd device daemon |
| 86 | # ========================================================= |
| 87 | |
| 88 | # build adbd in all non-simulator builds |
| 89 | BUILD_ADBD := false |
| 90 | ifneq ($(TARGET_SIMULATOR),true) |
| 91 | BUILD_ADBD := true |
| 92 | endif |
| 93 | |
| 94 | # build adbd for the Linux simulator build |
| 95 | # so we can use it to test the adb USB gadget driver on x86 |
Mike Lockwood | 63e6152 | 2009-08-06 10:58:00 -0400 | [diff] [blame] | 96 | #ifeq ($(HOST_OS),linux) |
| 97 | # BUILD_ADBD := true |
| 98 | #endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 99 | |
| 100 | |
| 101 | ifeq ($(BUILD_ADBD),true) |
| 102 | include $(CLEAR_VARS) |
| 103 | |
| 104 | LOCAL_SRC_FILES := \ |
| 105 | adb.c \ |
David 'Digit' Turner | 414ff7d | 2009-05-18 17:07:46 +0200 | [diff] [blame] | 106 | fdevent.c \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 107 | transport.c \ |
| 108 | transport_local.c \ |
| 109 | transport_usb.c \ |
| 110 | sockets.c \ |
| 111 | services.c \ |
| 112 | file_sync_service.c \ |
| 113 | jdwp_service.c \ |
| 114 | framebuffer_service.c \ |
| 115 | remount_service.c \ |
| 116 | usb_linux_client.c \ |
| 117 | log_service.c \ |
Raphael | 26f3de6 | 2009-08-11 11:08:45 -0700 | [diff] [blame^] | 118 | utils.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 119 | |
| 120 | LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter |
| 121 | LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE |
| 122 | |
| 123 | # TODO: This should probably be board specific, whether or not the kernel has |
| 124 | # the gadget driver; rather than relying on the architecture type. |
| 125 | ifeq ($(TARGET_ARCH),arm) |
| 126 | LOCAL_CFLAGS += -DANDROID_GADGET=1 |
| 127 | endif |
| 128 | |
| 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 | |
| 135 | ifeq ($(TARGET_SIMULATOR),true) |
| 136 | LOCAL_STATIC_LIBRARIES := libcutils |
| 137 | LOCAL_LDLIBS += -lpthread |
| 138 | include $(BUILD_HOST_EXECUTABLE) |
| 139 | else |
| 140 | LOCAL_STATIC_LIBRARIES := libcutils libc |
| 141 | include $(BUILD_EXECUTABLE) |
| 142 | endif |
| 143 | |
| 144 | endif |