1
# Copyright (C) 2007 Google Inc.
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
15
LOCAL_PATH:= $(call my-dir)
19
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \
20
$(LOCAL_PATH)/../../extras/ext4_utils \
21
$(LOCAL_PATH)/../../extras/f2fs_utils
22
LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c fs.c
23
LOCAL_MODULE := fastboot
24
LOCAL_MODULE_TAGS := debug
25
LOCAL_CFLAGS += -std=gnu99 -Werror
27
ifeq ($(HOST_OS),linux)
28
LOCAL_SRC_FILES += usb_linux.c util_linux.c
31
ifeq ($(HOST_OS),darwin)
32
LOCAL_SRC_FILES += usb_osx.c util_osx.c
33
LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \
37
ifeq ($(HOST_OS),windows)
38
LOCAL_SRC_FILES += usb_windows.c util_windows.c
39
EXTRA_STATIC_LIBS := AdbWinApi
40
ifneq ($(strip $(USE_CYGWIN)),)
42
LOCAL_LDLIBS += -lpthread
44
ifneq ($(strip $(USE_MINGW)),)
45
# MinGW under Linux case
46
LOCAL_LDLIBS += -lws2_32
47
USE_SYSDEPS_WIN32 := 1
49
LOCAL_C_INCLUDES += development/host/windows/usb/api
52
LOCAL_STATIC_LIBRARIES := \
53
$(EXTRA_STATIC_LIBS) \
60
ifneq ($(HOST_OS),windows)
61
LOCAL_STATIC_LIBRARIES += libselinux
62
endif # HOST_OS != windows
64
ifeq ($(HOST_OS),linux)
65
# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
66
LOCAL_CFLAGS += -DUSE_F2FS
67
LOCAL_LDFLAGS += -ldl -rdynamic -Wl,-rpath,.
68
LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn
69
# The following libf2fs_* are from system/extras/f2fs_utils,
70
# and do not use code in external/f2fs-tools.
71
LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host
74
include $(BUILD_HOST_EXECUTABLE)
76
my_dist_files := $(LOCAL_BUILT_MODULE)
77
ifeq ($(HOST_OS),linux)
78
my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX)
80
$(call dist-for-goals,dist_files sdk,$(my_dist_files))
84
ifeq ($(HOST_OS),linux)
86
LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c
87
LOCAL_MODULE := usbtest
88
LOCAL_CFLAGS := -Werror
89
include $(BUILD_HOST_EXECUTABLE)
92
ifeq ($(HOST_OS),windows)
93
$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll