The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # Copyright (C) 2007 Google Inc. |
| 2 | # |
| 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 |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 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. |
| 14 | |
| 15 | LOCAL_PATH:= $(call my-dir) |
| 16 | |
Elliott Hughes | 4d4f64f | 2017-05-08 11:30:34 -0700 | [diff] [blame] | 17 | include $(LOCAL_PATH)/../platform_tools_tool_version.mk |
| 18 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 19 | fastboot_cflags := -Wall -Wextra -Werror -Wunreachable-code |
| 20 | fastboot_cflags += -DFASTBOOT_VERSION="\"$(tool_version)\"" |
| 21 | fastboot_cflags_darwin := -Wno-unused-parameter |
| 22 | fastboot_ldlibs_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon |
| 23 | fastboot_ldlibs_windows := -lws2_32 |
| 24 | # Don't add anything here, we don't want additional shared dependencies |
| 25 | # on the host fastboot tool, and shared libraries that link against libc++ |
| 26 | # will violate ODR. |
| 27 | fastboot_shared_libs := |
| 28 | fastboot_static_libs := \ |
| 29 | libziparchive \ |
| 30 | libsparse \ |
| 31 | libutils \ |
| 32 | liblog \ |
| 33 | libz \ |
| 34 | libdiagnose_usb \ |
| 35 | libbase \ |
| 36 | libcutils \ |
| 37 | libgtest_host \ |
| 38 | |
| 39 | fastboot_stl := libc++_static |
| 40 | |
| 41 | # |
| 42 | # Build host libfastboot. |
| 43 | # |
| 44 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 45 | include $(CLEAR_VARS) |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 46 | LOCAL_MODULE := libfastboot |
| 47 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 48 | |
David Pursell | 572bce2 | 2016-01-15 14:19:56 -0800 | [diff] [blame] | 49 | LOCAL_SRC_FILES := \ |
| 50 | bootimg_utils.cpp \ |
| 51 | engine.cpp \ |
| 52 | fastboot.cpp \ |
| 53 | fs.cpp\ |
| 54 | protocol.cpp \ |
| 55 | socket.cpp \ |
David Pursell | 2ec418a | 2016-01-20 08:32:08 -0800 | [diff] [blame] | 56 | tcp.cpp \ |
David Pursell | 4601c97 | 2016-02-05 15:35:09 -0800 | [diff] [blame] | 57 | udp.cpp \ |
David Pursell | 572bce2 | 2016-01-15 14:19:56 -0800 | [diff] [blame] | 58 | util.cpp \ |
| 59 | |
Elliott Hughes | 82ff315 | 2016-08-31 15:07:18 -0700 | [diff] [blame] | 60 | LOCAL_SRC_FILES_darwin := usb_osx.cpp |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 61 | LOCAL_SRC_FILES_linux := usb_linux.cpp |
Elliott Hughes | 82ff315 | 2016-08-31 15:07:18 -0700 | [diff] [blame] | 62 | LOCAL_SRC_FILES_windows := usb_windows.cpp |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 63 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 64 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 65 | LOCAL_CFLAGS := $(fastboot_cflags) |
| 66 | LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin) |
| 67 | LOCAL_CXX_STL := $(fastboot_stl) |
| 68 | LOCAL_HEADER_LIBRARIES := bootimg_headers |
| 69 | LOCAL_LDLIBS_darwin := $(fastboot_ldflags_darwin) |
| 70 | LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows) |
| 71 | LOCAL_SHARED_LIBRARIES := $(fastboot_shared_libs) |
| 72 | LOCAL_STATIC_LIBRARIES := $(fastboot_static_libs) |
| 73 | include $(BUILD_HOST_STATIC_LIBRARY) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 75 | # |
| 76 | # Build host fastboot / fastboot.exe |
| 77 | # |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 78 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 79 | include $(CLEAR_VARS) |
| 80 | LOCAL_MODULE := fastboot |
| 81 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 82 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 83 | LOCAL_CFLAGS := $(fastboot_cflags) |
| 84 | LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin) |
| 85 | LOCAL_CXX_STL := $(fastboot_stl) |
| 86 | LOCAL_LDLIBS_darwin := $(fastboot_ldflags_darwin) |
| 87 | LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows) |
| 88 | LOCAL_REQUIRED_MODULES := mke2fs make_f2fs |
| 89 | LOCAL_REQUIRED_MODULES_darwin := e2fsdroid mke2fs.conf sload_f2fs |
| 90 | LOCAL_REQUIRED_MODULES_linux := e2fsdroid mke2fs.conf sload_f2fs |
| 91 | LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi |
| 92 | LOCAL_SRC_FILES := main.cpp |
| 93 | LOCAL_SHARED_LIBRARIES := $(fastboot_shared_libs) |
| 94 | LOCAL_SHARED_LIBRARIES_windows := AdbWinApi |
| 95 | LOCAL_STATIC_LIBRARIES := libfastboot $(fastboot_static_libs) |
| 96 | LOCAL_STATIC_LIBRARIES_darwin := libselinux |
| 97 | LOCAL_STATIC_LIBRARIES_linux := libselinux |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 98 | include $(BUILD_HOST_EXECUTABLE) |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 99 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 100 | # |
| 101 | # Package fastboot-related executables. |
| 102 | # |
| 103 | |
Dan Willemsen | 94e4dc2 | 2018-04-09 14:26:23 -0700 | [diff] [blame] | 104 | my_dist_files := $(HOST_OUT_EXECUTABLES)/fastboot |
Jin Qian | 3fdf5ec | 2017-07-19 15:19:16 -0700 | [diff] [blame] | 105 | my_dist_files += $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX) |
| 106 | my_dist_files += $(HOST_OUT_EXECUTABLES)/e2fsdroid$(HOST_EXECUTABLE_SUFFIX) |
Jaegeuk Kim | 8d9b6ee | 2017-11-15 10:55:07 -0800 | [diff] [blame] | 107 | my_dist_files += $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX) |
Jaegeuk Kim | 899ad55 | 2017-11-28 19:26:34 -0800 | [diff] [blame] | 108 | my_dist_files += $(HOST_OUT_EXECUTABLES)/sload_f2fs$(HOST_EXECUTABLE_SUFFIX) |
Ying Wang | 71edfc8 | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 109 | $(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files)) |
| 110 | ifdef HOST_CROSS_OS |
| 111 | # Archive fastboot.exe for win_sdk build. |
| 112 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_fastboot.BUILT)) |
| 113 | endif |
Ying Wang | 6b048ce | 2014-06-19 14:15:03 -0700 | [diff] [blame] | 114 | my_dist_files := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 115 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 116 | # |
| 117 | # Build host fastboot_test. |
| 118 | # |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 119 | |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 120 | include $(CLEAR_VARS) |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 121 | LOCAL_MODULE := fastboot_test |
| 122 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 123 | |
David Pursell | c3a4669 | 2016-01-29 08:10:50 -0800 | [diff] [blame] | 124 | LOCAL_SRC_FILES := \ |
David Pursell | c3a4669 | 2016-01-29 08:10:50 -0800 | [diff] [blame] | 125 | socket_mock.cpp \ |
| 126 | socket_test.cpp \ |
David Pursell | 2ec418a | 2016-01-20 08:32:08 -0800 | [diff] [blame] | 127 | tcp_test.cpp \ |
David Pursell | 4601c97 | 2016-02-05 15:35:09 -0800 | [diff] [blame] | 128 | udp_test.cpp \ |
David Pursell | c3a4669 | 2016-01-29 08:10:50 -0800 | [diff] [blame] | 129 | |
Elliott Hughes | 11ff345 | 2018-04-09 13:58:41 -0700 | [diff] [blame^] | 130 | LOCAL_CFLAGS := $(fastboot_cflags) |
| 131 | LOCAL_CFLAGS_darwin := $(fastboot_cflags_darwin) |
| 132 | LOCAL_CXX_STL := $(fastboot_stl) |
| 133 | LOCAL_LDLIBS_darwin := $(fastboot_ldflags_darwin) |
| 134 | LOCAL_LDLIBS_windows := $(fastboot_ldlibs_windows) |
| 135 | LOCAL_STATIC_LIBRARIES := libfastboot $(fastboot_static_libs) |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 136 | include $(BUILD_HOST_NATIVE_TEST) |