2009-03-04 04:32:55 +01:00
|
|
|
# Copyright (C) 2007 Google Inc.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
|
2015-06-02 22:50:00 +02:00
|
|
|
fastboot_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2015-12-12 04:07:01 +01:00
|
|
|
LOCAL_C_INCLUDES := \
|
|
|
|
$(LOCAL_PATH)/../adb \
|
|
|
|
$(LOCAL_PATH)/../mkbootimg \
|
|
|
|
$(LOCAL_PATH)/../../extras/f2fs_utils \
|
|
|
|
|
2016-01-15 23:19:56 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
bootimg_utils.cpp \
|
|
|
|
engine.cpp \
|
|
|
|
fastboot.cpp \
|
|
|
|
fs.cpp\
|
|
|
|
protocol.cpp \
|
|
|
|
socket.cpp \
|
2016-01-20 17:32:08 +01:00
|
|
|
tcp.cpp \
|
2016-02-06 00:35:09 +01:00
|
|
|
udp.cpp \
|
2016-01-15 23:19:56 +01:00
|
|
|
util.cpp \
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := fastboot
|
2012-09-26 18:58:07 +02:00
|
|
|
LOCAL_MODULE_TAGS := debug
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_MODULE_HOST_OS := darwin linux windows
|
2015-05-11 17:59:46 +02:00
|
|
|
LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2015-06-02 22:50:00 +02:00
|
|
|
LOCAL_CFLAGS += -DFASTBOOT_REVISION='"$(fastboot_version)"'
|
|
|
|
|
2016-09-01 00:07:18 +02:00
|
|
|
LOCAL_SRC_FILES_linux := usb_linux.cpp
|
2016-01-15 02:18:27 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES_linux := libselinux
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2016-09-01 00:07:18 +02:00
|
|
|
LOCAL_SRC_FILES_darwin := usb_osx.cpp
|
2016-01-15 02:18:27 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES_darwin := libselinux
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
|
|
|
|
LOCAL_CFLAGS_darwin := -Wno-unused-parameter
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2016-09-01 00:07:18 +02:00
|
|
|
LOCAL_SRC_FILES_windows := usb_windows.cpp
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES_windows := AdbWinApi
|
|
|
|
LOCAL_REQUIRED_MODULES_windows := AdbWinApi
|
|
|
|
LOCAL_LDLIBS_windows := -lws2_32
|
|
|
|
LOCAL_C_INCLUDES_windows := development/host/windows/usb/api
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2012-07-18 21:03:33 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES := \
|
2016-08-26 20:12:38 +02:00
|
|
|
libziparchive \
|
2017-01-11 23:03:11 +01:00
|
|
|
libext4_utils \
|
2017-01-11 23:37:50 +01:00
|
|
|
libsparse \
|
2015-03-19 07:12:44 +01:00
|
|
|
libutils \
|
|
|
|
liblog \
|
2015-04-27 17:25:53 +02:00
|
|
|
libz \
|
2015-12-12 04:07:01 +01:00
|
|
|
libdiagnose_usb \
|
2015-11-11 19:02:29 +01:00
|
|
|
libbase \
|
2016-01-15 02:18:27 +01:00
|
|
|
libcutils \
|
2016-02-01 18:42:09 +01:00
|
|
|
libgtest_host \
|
2014-06-18 08:43:18 +02:00
|
|
|
|
|
|
|
# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_CFLAGS_linux := -DUSE_F2FS
|
|
|
|
LOCAL_LDFLAGS_linux := -ldl -rdynamic -Wl,-rpath,.
|
|
|
|
LOCAL_REQUIRED_MODULES_linux := libf2fs_fmt_host_dyn
|
2014-06-18 08:43:18 +02:00
|
|
|
# The following libf2fs_* are from system/extras/f2fs_utils,
|
|
|
|
# and do not use code in external/f2fs-tools.
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES_linux += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host
|
2014-06-18 08:43:18 +02:00
|
|
|
|
2015-08-13 23:43:34 +02:00
|
|
|
LOCAL_CXX_STL := libc++_static
|
2015-04-17 01:21:44 +02:00
|
|
|
|
|
|
|
# Don't add anything here, we don't want additional shared dependencies
|
|
|
|
# on the host fastboot tool, and shared libraries that link against libc++
|
|
|
|
# will violate ODR
|
|
|
|
LOCAL_SHARED_LIBRARIES :=
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
2012-07-24 04:15:14 +02:00
|
|
|
|
2014-06-19 23:15:03 +02:00
|
|
|
my_dist_files := $(LOCAL_BUILT_MODULE)
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX)
|
|
|
|
endif
|
2016-03-01 04:27:06 +01:00
|
|
|
$(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files))
|
|
|
|
ifdef HOST_CROSS_OS
|
|
|
|
# Archive fastboot.exe for win_sdk build.
|
|
|
|
$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_fastboot.BUILT))
|
|
|
|
endif
|
2014-06-19 23:15:03 +02:00
|
|
|
my_dist_files :=
|
2009-03-04 04:32:55 +01:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
include $(CLEAR_VARS)
|
2015-06-24 05:27:58 +02:00
|
|
|
LOCAL_SRC_FILES := usbtest.cpp usb_linux.cpp util.cpp
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := usbtest
|
2014-04-30 23:05:28 +02:00
|
|
|
LOCAL_CFLAGS := -Werror
|
2015-10-30 19:22:01 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := libbase
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
|
|
|
endif
|
2015-12-10 02:09:54 +01:00
|
|
|
|
|
|
|
# fastboot_test
|
|
|
|
# =========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_MODULE := fastboot_test
|
|
|
|
LOCAL_MODULE_HOST_OS := darwin linux windows
|
|
|
|
|
2016-01-29 17:10:50 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
socket.cpp \
|
|
|
|
socket_mock.cpp \
|
|
|
|
socket_test.cpp \
|
2016-01-20 17:32:08 +01:00
|
|
|
tcp.cpp \
|
|
|
|
tcp_test.cpp \
|
2016-02-06 00:35:09 +01:00
|
|
|
udp.cpp \
|
|
|
|
udp_test.cpp \
|
2016-01-29 17:10:50 +01:00
|
|
|
|
2016-01-15 02:18:27 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := libbase libcutils
|
2015-12-10 02:09:54 +01:00
|
|
|
|
|
|
|
LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
|
|
|
|
|
|
|
|
LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
|
|
|
|
LOCAL_CFLAGS_darwin := -Wno-unused-parameter
|
|
|
|
|
|
|
|
LOCAL_LDLIBS_windows := -lws2_32
|
|
|
|
|
|
|
|
include $(BUILD_HOST_NATIVE_TEST)
|