| 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 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 19 | include $(CLEAR_VARS) | 
 | 20 |  | 
| SzuWei Lin | b3526e1 | 2017-05-10 18:15:03 +0800 | [diff] [blame] | 21 | LOCAL_CFLAGS += -DFASTBOOT_VERSION="\"$(tool_version)\"" | 
| Elliott Hughes | 4d4f64f | 2017-05-08 11:30:34 -0700 | [diff] [blame] | 22 |  | 
| Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 23 | LOCAL_C_INCLUDES := \ | 
 | 24 |   $(LOCAL_PATH)/../adb \ | 
 | 25 |   $(LOCAL_PATH)/../mkbootimg \ | 
| Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 26 |   $(LOCAL_PATH)/../../extras/f2fs_utils \ | 
 | 27 |  | 
| David Pursell | 572bce2 | 2016-01-15 14:19:56 -0800 | [diff] [blame] | 28 | LOCAL_SRC_FILES := \ | 
 | 29 |     bootimg_utils.cpp \ | 
 | 30 |     engine.cpp \ | 
 | 31 |     fastboot.cpp \ | 
 | 32 |     fs.cpp\ | 
 | 33 |     protocol.cpp \ | 
 | 34 |     socket.cpp \ | 
| David Pursell | 2ec418a | 2016-01-20 08:32:08 -0800 | [diff] [blame] | 35 |     tcp.cpp \ | 
| David Pursell | 4601c97 | 2016-02-05 15:35:09 -0800 | [diff] [blame] | 36 |     udp.cpp \ | 
| David Pursell | 572bce2 | 2016-01-15 14:19:56 -0800 | [diff] [blame] | 37 |     util.cpp \ | 
 | 38 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 39 | LOCAL_MODULE := fastboot | 
| Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 40 | LOCAL_MODULE_TAGS := debug | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 41 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
| Narayan Kamath | f6e9ffb | 2015-05-11 16:59:46 +0100 | [diff] [blame] | 42 | LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 43 |  | 
| Elliott Hughes | 82ff315 | 2016-08-31 15:07:18 -0700 | [diff] [blame] | 44 | LOCAL_SRC_FILES_linux := usb_linux.cpp | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 45 | LOCAL_STATIC_LIBRARIES_linux := libselinux | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 46 |  | 
| Elliott Hughes | 82ff315 | 2016-08-31 15:07:18 -0700 | [diff] [blame] | 47 | LOCAL_SRC_FILES_darwin := usb_osx.cpp | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 48 | LOCAL_STATIC_LIBRARIES_darwin := libselinux | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 49 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon | 
 | 50 | LOCAL_CFLAGS_darwin := -Wno-unused-parameter | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 51 |  | 
| Elliott Hughes | 82ff315 | 2016-08-31 15:07:18 -0700 | [diff] [blame] | 52 | LOCAL_SRC_FILES_windows := usb_windows.cpp | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 53 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi | 
| Chris Fries | 4bf1be7 | 2017-04-11 09:40:40 -0500 | [diff] [blame] | 54 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 55 | LOCAL_LDLIBS_windows := -lws2_32 | 
 | 56 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 57 |  | 
| Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 58 | LOCAL_STATIC_LIBRARIES := \ | 
| Colin Cross | 99f6b86 | 2016-08-26 11:12:38 -0700 | [diff] [blame] | 59 |     libziparchive \ | 
| Alex Deymo | 705353a | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 60 |     libext4_utils \ | 
| Alex Deymo | b0c3959 | 2017-01-11 14:37:50 -0800 | [diff] [blame] | 61 |     libsparse \ | 
| Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 62 |     libutils \ | 
 | 63 |     liblog \ | 
| Narayan Kamath | e97e66e | 2015-04-27 16:25:53 +0100 | [diff] [blame] | 64 |     libz \ | 
| Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 65 |     libdiagnose_usb \ | 
| Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 66 |     libbase \ | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 67 |     libcutils \ | 
| David Pursell | b34e4a0 | 2016-02-01 09:42:09 -0800 | [diff] [blame] | 68 |     libgtest_host \ | 
| JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 69 |  | 
| JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 70 | # libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn") | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 71 | LOCAL_CFLAGS_linux := -DUSE_F2FS | 
 | 72 | LOCAL_LDFLAGS_linux := -ldl -rdynamic -Wl,-rpath,. | 
 | 73 | LOCAL_REQUIRED_MODULES_linux := libf2fs_fmt_host_dyn | 
| JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 74 | # The following libf2fs_* are from system/extras/f2fs_utils, | 
 | 75 | # and do not use code in external/f2fs-tools. | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 76 | LOCAL_STATIC_LIBRARIES_linux += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host | 
| JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 77 |  | 
| Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 78 | LOCAL_CXX_STL := libc++_static | 
| Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 79 |  | 
 | 80 | # Don't add anything here, we don't want additional shared dependencies | 
 | 81 | # on the host fastboot tool, and shared libraries that link against libc++ | 
 | 82 | # will violate ODR | 
 | 83 | LOCAL_SHARED_LIBRARIES := | 
 | 84 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 85 | include $(BUILD_HOST_EXECUTABLE) | 
| Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 86 |  | 
| Ying Wang | 6b048ce | 2014-06-19 14:15:03 -0700 | [diff] [blame] | 87 | my_dist_files := $(LOCAL_BUILT_MODULE) | 
 | 88 | ifeq ($(HOST_OS),linux) | 
 | 89 | my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX) | 
 | 90 | endif | 
| Ying Wang | 71edfc8 | 2016-02-29 19:27:06 -0800 | [diff] [blame] | 91 | $(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files)) | 
 | 92 | ifdef HOST_CROSS_OS | 
 | 93 | # Archive fastboot.exe for win_sdk build. | 
 | 94 | $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_fastboot.BUILT)) | 
 | 95 | endif | 
| Ying Wang | 6b048ce | 2014-06-19 14:15:03 -0700 | [diff] [blame] | 96 | my_dist_files := | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 97 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 98 | ifeq ($(HOST_OS),linux) | 
 | 99 | include $(CLEAR_VARS) | 
| Elliott Hughes | b3748de | 2015-06-23 20:27:58 -0700 | [diff] [blame] | 100 | LOCAL_SRC_FILES := usbtest.cpp usb_linux.cpp util.cpp | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 101 | LOCAL_MODULE := usbtest | 
| Mark Salyzyn | 5957c1f | 2014-04-30 14:05:28 -0700 | [diff] [blame] | 102 | LOCAL_CFLAGS := -Werror | 
| David Pursell | 0b15663 | 2015-10-30 11:22:01 -0700 | [diff] [blame] | 103 | LOCAL_STATIC_LIBRARIES := libbase | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 104 | include $(BUILD_HOST_EXECUTABLE) | 
 | 105 | endif | 
| David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 106 |  | 
 | 107 | # fastboot_test | 
 | 108 | # ========================================================= | 
 | 109 | include $(CLEAR_VARS) | 
 | 110 |  | 
 | 111 | LOCAL_MODULE := fastboot_test | 
 | 112 | LOCAL_MODULE_HOST_OS := darwin linux windows | 
 | 113 |  | 
| David Pursell | c3a4669 | 2016-01-29 08:10:50 -0800 | [diff] [blame] | 114 | LOCAL_SRC_FILES := \ | 
 | 115 |     socket.cpp \ | 
 | 116 |     socket_mock.cpp \ | 
 | 117 |     socket_test.cpp \ | 
| David Pursell | 2ec418a | 2016-01-20 08:32:08 -0800 | [diff] [blame] | 118 |     tcp.cpp \ | 
 | 119 |     tcp_test.cpp \ | 
| David Pursell | 4601c97 | 2016-02-05 15:35:09 -0800 | [diff] [blame] | 120 |     udp.cpp \ | 
 | 121 |     udp_test.cpp \ | 
| David Pursell | c3a4669 | 2016-01-29 08:10:50 -0800 | [diff] [blame] | 122 |  | 
| David Pursell | 0eb8e1b | 2016-01-14 17:18:27 -0800 | [diff] [blame] | 123 | LOCAL_STATIC_LIBRARIES := libbase libcutils | 
| David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 124 |  | 
 | 125 | LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code | 
 | 126 |  | 
| David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 127 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon | 
 | 128 | LOCAL_CFLAGS_darwin := -Wno-unused-parameter | 
| David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 129 |  | 
| David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame] | 130 | LOCAL_LDLIBS_windows := -lws2_32 | 
 | 131 |  | 
 | 132 | include $(BUILD_HOST_NATIVE_TEST) |