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)
|
|
|
|
|
2017-05-08 20:30:34 +02:00
|
|
|
include $(LOCAL_PATH)/../platform_tools_tool_version.mk
|
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
fastboot_cflags := -Wall -Wextra -Werror -Wunreachable-code
|
|
|
|
fastboot_cflags += -DFASTBOOT_VERSION="\"$(tool_version)\""
|
|
|
|
fastboot_cflags_darwin := -Wno-unused-parameter
|
|
|
|
fastboot_ldlibs_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
|
|
|
|
fastboot_ldlibs_windows := -lws2_32
|
|
|
|
# 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.
|
|
|
|
fastboot_shared_libs :=
|
|
|
|
fastboot_static_libs := \
|
|
|
|
libziparchive \
|
|
|
|
libsparse \
|
|
|
|
libutils \
|
|
|
|
liblog \
|
|
|
|
libz \
|
|
|
|
libdiagnose_usb \
|
|
|
|
libbase \
|
|
|
|
libcutils \
|
|
|
|
libgtest_host \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
fastboot_stl := libc++_static
|
2017-05-08 20:30:34 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
#
|
|
|
|
# Build host libfastboot.
|
|
|
|
#
|
2018-03-29 03:45:35 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := libfastboot
|
|
|
|
LOCAL_MODULE_HOST_OS := darwin linux windows
|
2015-12-12 04:07:01 +01:00
|
|
|
|
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 \
|
|
|
|
|
2016-09-01 00:07:18 +02:00
|
|
|
LOCAL_SRC_FILES_darwin := usb_osx.cpp
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_SRC_FILES_linux := usb_linux.cpp
|
2016-09-01 00:07:18 +02:00
|
|
|
LOCAL_SRC_FILES_windows := usb_windows.cpp
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_C_INCLUDES_windows := development/host/windows/usb/api
|
|
|
|
LOCAL_CFLAGS := $(fastboot_cflags)
|
|
|
|
LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin)
|
|
|
|
LOCAL_CXX_STL := $(fastboot_stl)
|
|
|
|
LOCAL_HEADER_LIBRARIES := bootimg_headers
|
2018-04-11 07:55:55 +02:00
|
|
|
LOCAL_LDLIBS_darwin := $(fastboot_ldlibs_darwin)
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows)
|
|
|
|
LOCAL_SHARED_LIBRARIES := $(fastboot_shared_libs)
|
|
|
|
LOCAL_STATIC_LIBRARIES := $(fastboot_static_libs)
|
|
|
|
include $(BUILD_HOST_STATIC_LIBRARY)
|
2014-06-18 08:43:18 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
#
|
|
|
|
# Build host fastboot / fastboot.exe
|
|
|
|
#
|
2015-04-17 01:21:44 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := fastboot
|
|
|
|
LOCAL_MODULE_HOST_OS := darwin linux windows
|
2015-04-17 01:21:44 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_CFLAGS := $(fastboot_cflags)
|
|
|
|
LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin)
|
|
|
|
LOCAL_CXX_STL := $(fastboot_stl)
|
2018-04-10 23:22:13 +02:00
|
|
|
LOCAL_HEADER_LIBRARIES := bootimg_headers
|
2018-04-11 07:55:55 +02:00
|
|
|
LOCAL_LDLIBS_darwin := $(fastboot_ldlibs_darwin)
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows)
|
|
|
|
LOCAL_REQUIRED_MODULES := mke2fs make_f2fs
|
|
|
|
LOCAL_REQUIRED_MODULES_darwin := e2fsdroid mke2fs.conf sload_f2fs
|
|
|
|
LOCAL_REQUIRED_MODULES_linux := e2fsdroid mke2fs.conf sload_f2fs
|
|
|
|
LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi
|
|
|
|
LOCAL_SRC_FILES := main.cpp
|
|
|
|
LOCAL_SHARED_LIBRARIES := $(fastboot_shared_libs)
|
|
|
|
LOCAL_SHARED_LIBRARIES_windows := AdbWinApi
|
|
|
|
LOCAL_STATIC_LIBRARIES := libfastboot $(fastboot_static_libs)
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
2012-07-24 04:15:14 +02:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
#
|
|
|
|
# Package fastboot-related executables.
|
|
|
|
#
|
|
|
|
|
2018-04-09 23:26:23 +02:00
|
|
|
my_dist_files := $(HOST_OUT_EXECUTABLES)/fastboot
|
2017-07-20 00:19:16 +02:00
|
|
|
my_dist_files += $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX)
|
|
|
|
my_dist_files += $(HOST_OUT_EXECUTABLES)/e2fsdroid$(HOST_EXECUTABLE_SUFFIX)
|
2017-11-15 19:55:07 +01:00
|
|
|
my_dist_files += $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX)
|
2017-11-29 04:26:34 +01:00
|
|
|
my_dist_files += $(HOST_OUT_EXECUTABLES)/sload_f2fs$(HOST_EXECUTABLE_SUFFIX)
|
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
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
#
|
|
|
|
# Build host fastboot_test.
|
|
|
|
#
|
2015-12-10 02:09:54 +01:00
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := fastboot_test
|
|
|
|
LOCAL_MODULE_HOST_OS := darwin linux windows
|
2018-04-10 23:22:13 +02:00
|
|
|
LOCAL_MODULE_HOST_CROSS_ARCH := x86 # Avoid trying to build for win64.
|
2015-12-10 02:09:54 +01:00
|
|
|
|
2016-01-29 17:10:50 +01:00
|
|
|
LOCAL_SRC_FILES := \
|
2018-04-10 23:22:13 +02:00
|
|
|
fastboot_test.cpp \
|
2016-01-29 17:10:50 +01:00
|
|
|
socket_mock.cpp \
|
|
|
|
socket_test.cpp \
|
2016-01-20 17:32:08 +01:00
|
|
|
tcp_test.cpp \
|
2016-02-06 00:35:09 +01:00
|
|
|
udp_test.cpp \
|
2016-01-29 17:10:50 +01:00
|
|
|
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_CFLAGS := $(fastboot_cflags)
|
|
|
|
LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin)
|
|
|
|
LOCAL_CXX_STL := $(fastboot_stl)
|
2018-04-10 23:22:13 +02:00
|
|
|
LOCAL_HEADER_LIBRARIES := bootimg_headers
|
2018-04-11 07:55:55 +02:00
|
|
|
LOCAL_LDLIBS_darwin := $(fastboot_ldlibs_darwin)
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows)
|
2018-04-10 23:22:13 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := $(fastboot_shared_libs)
|
|
|
|
LOCAL_SHARED_LIBRARIES_windows := AdbWinApi
|
2018-04-09 22:58:41 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES := libfastboot $(fastboot_static_libs)
|
2015-12-10 02:09:54 +01:00
|
|
|
include $(BUILD_HOST_NATIVE_TEST)
|