diff options
author | Dan Albert <danalbert@google.com> | 2014-11-24 23:34:35 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-01-26 16:45:34 -0800 |
commit | 630b9afeb0d7f0e5e053db0f900cfb65d914cb1a (patch) | |
tree | cc2493e93b2a5f0b08ba9305838c47535f9913f9 /adb/Android.mk | |
parent | fb538fb13d930a7398695d1044ceaaf854949018 (diff) | |
download | system_core-630b9afeb0d7f0e5e053db0f900cfb65d914cb1a.tar.gz system_core-630b9afeb0d7f0e5e053db0f900cfb65d914cb1a.tar.bz2 system_core-630b9afeb0d7f0e5e053db0f900cfb65d914cb1a.zip |
Begin moving code from adb to libadb.
Much of adb is duplicated in bootable/recovery/minadb and fastboot.
Changes made to adb rarely get ported to the other two, so the trees
have diverged a bit. We'd like to stop this because it is a
maintenance nightmare, but the divergence makes this difficult to do
all at once. For now, we will start small by moving common files into
a static library. Hopefully some day we can get enough of adb in here
that we no longer need minadb.
Bug: 17626262
Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
Diffstat (limited to 'adb/Android.mk')
-rw-r--r-- | adb/Android.mk | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/adb/Android.mk b/adb/Android.mk index 8ebcbf0d2..cbb49f483 100644 --- a/adb/Android.mk +++ b/adb/Android.mk @@ -5,6 +5,35 @@ LOCAL_PATH:= $(call my-dir) +# libadb +# ========================================================= + +# Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes +# made to adb rarely get ported to the other two, so the trees have diverged a +# bit. We'd like to stop this because it is a maintenance nightmare, but the +# divergence makes this difficult to do all at once. For now, we will start +# small by moving common files into a static library. Hopefully some day we can +# get enough of adb in here that we no longer need minadb. https://b/17626262 +LIBADB_SRC_FILES := +LIBADB_C_FLAGS := -Wall -Werror -D_XOPEN_SOURCE -D_GNU_SOURCE + +include $(CLEAR_VARS) +LOCAL_MODULE := libadb +LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=0 +LOCAL_SRC_FILES := $(LIBADB_SRC_FILES) fdevent.cpp +include $(BUILD_STATIC_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := libadb +LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1 +LOCAL_SRC_FILES := $(LIBADB_SRC_FILES) +ifeq ($(HOST_OS),windows) + LOCAL_SRC_FILES += sysdeps_wind32.c +else + LOCAL_SRC_FILES += fdevent.cpp +endif +include $(BUILD_HOST_STATIC_LIBRARY) + # adb host tool # ========================================================= include $(CLEAR_VARS) @@ -37,10 +66,6 @@ ifeq ($(HOST_OS),windows) USB_SRCS := usb_windows.c EXTRA_SRCS := get_my_path_windows.c EXTRA_STATIC_LIBS := AdbWinApi - ifneq ($(strip $(USE_CYGWIN)),) - # Pure cygwin case - LOCAL_LDLIBS += -lpthread -lgdi32 - endif ifneq ($(strip $(USE_MINGW)),) # MinGW under Linux case LOCAL_LDLIBS += -lws2_32 -lgdi32 @@ -66,8 +91,6 @@ LOCAL_SRC_FILES := \ ifneq ($(USE_SYSDEPS_WIN32),) LOCAL_SRC_FILES += sysdeps_win32.c -else - LOCAL_SRC_FILES += fdevent.c endif LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror @@ -75,7 +98,13 @@ LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE LOCAL_MODULE := adb LOCAL_MODULE_TAGS := debug -LOCAL_STATIC_LIBRARIES := libzipfile libz libcrypto_static $(EXTRA_STATIC_LIBS) +LOCAL_STATIC_LIBRARIES := \ + libadb \ + libzipfile \ + libz \ + libcrypto_static \ + $(EXTRA_STATIC_LIBS) \ + ifeq ($(USE_SYSDEPS_WIN32),) LOCAL_STATIC_LIBRARIES += libcutils endif @@ -99,7 +128,6 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ adb.c \ - fdevent.c \ transport.c \ transport_local.c \ transport_usb.c \ @@ -134,15 +162,14 @@ LOCAL_MODULE := adbd LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) -LOCAL_C_INCLUDES += system/extras/ext4_utils system/core/fs_mgr/include -LOCAL_STATIC_LIBRARIES := liblog \ - libfs_mgr \ - libcutils \ - libc \ - libmincrypt \ - libselinux \ - libext4_utils_static +LOCAL_STATIC_LIBRARIES := \ + libadb \ + liblog \ + libcutils \ + libc \ + libmincrypt \ + libselinux \ LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -168,7 +195,6 @@ LOCAL_SRC_FILES := \ file_sync_client.c \ get_my_path_linux.c \ usb_linux.c \ - fdevent.c LOCAL_CFLAGS := \ -O2 \ @@ -181,7 +207,7 @@ LOCAL_CFLAGS := \ LOCAL_MODULE := adb -LOCAL_STATIC_LIBRARIES := libzipfile libz libcutils liblog +LOCAL_STATIC_LIBRARIES := libadb libzipfile libz libcutils liblog LOCAL_SHARED_LIBRARIES := libcrypto |