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 | 379646b | 2015-06-02 13:50:00 -0700 | [diff] [blame] | 17 | fastboot_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android |
| 18 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 19 | include $(CLEAR_VARS) |
| 20 | |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 21 | LOCAL_C_INCLUDES := \ |
| 22 | $(LOCAL_PATH)/../adb \ |
| 23 | $(LOCAL_PATH)/../mkbootimg \ |
JP Abgrall | 1235158 | 2014-06-17 17:01:14 -0700 | [diff] [blame] | 24 | $(LOCAL_PATH)/../../extras/ext4_utils \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 25 | $(LOCAL_PATH)/../../extras/f2fs_utils \ |
| 26 | |
Elliott Hughes | b3748de | 2015-06-23 20:27:58 -0700 | [diff] [blame] | 27 | LOCAL_SRC_FILES := protocol.cpp engine.cpp bootimg_utils.cpp fastboot.cpp util.cpp fs.cpp |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 28 | LOCAL_MODULE := fastboot |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 29 | LOCAL_MODULE_TAGS := debug |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 30 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Elliott Hughes | 253c18d | 2015-03-18 22:47:09 -0700 | [diff] [blame] | 31 | LOCAL_CONLYFLAGS += -std=gnu99 |
Narayan Kamath | f6e9ffb | 2015-05-11 16:59:46 +0100 | [diff] [blame] | 32 | LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 33 | |
Elliott Hughes | 379646b | 2015-06-02 13:50:00 -0700 | [diff] [blame] | 34 | LOCAL_CFLAGS += -DFASTBOOT_REVISION='"$(fastboot_version)"' |
| 35 | |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame^] | 36 | LOCAL_SRC_FILES_linux := socket_unix.cpp usb_linux.cpp util_linux.cpp |
| 37 | LOCAL_STATIC_LIBRARIES_linux := libcutils libselinux |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 38 | |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame^] | 39 | LOCAL_SRC_FILES_darwin := socket_unix.cpp usb_osx.cpp util_osx.cpp |
| 40 | LOCAL_STATIC_LIBRARIES_darwin := libcutils libselinux |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 41 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon |
| 42 | LOCAL_CFLAGS_darwin := -Wno-unused-parameter |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 43 | |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame^] | 44 | LOCAL_SRC_FILES_windows := socket_windows.cpp usb_windows.cpp util_windows.cpp |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 45 | LOCAL_STATIC_LIBRARIES_windows := AdbWinApi |
| 46 | LOCAL_REQUIRED_MODULES_windows := AdbWinApi |
| 47 | LOCAL_LDLIBS_windows := -lws2_32 |
| 48 | LOCAL_C_INCLUDES_windows := development/host/windows/usb/api |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 49 | |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 50 | LOCAL_STATIC_LIBRARIES := \ |
Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 51 | libziparchive-host \ |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 52 | libext4_utils_host \ |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 53 | libsparse_host \ |
Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 54 | libutils \ |
| 55 | liblog \ |
Narayan Kamath | e97e66e | 2015-04-27 16:25:53 +0100 | [diff] [blame] | 56 | libz \ |
Elliott Hughes | 1b708d3 | 2015-12-11 19:07:01 -0800 | [diff] [blame] | 57 | libdiagnose_usb \ |
Elliott Hughes | c1fd492 | 2015-11-11 18:02:29 +0000 | [diff] [blame] | 58 | libbase \ |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 59 | |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 60 | # libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn") |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 61 | LOCAL_CFLAGS_linux := -DUSE_F2FS |
| 62 | LOCAL_LDFLAGS_linux := -ldl -rdynamic -Wl,-rpath,. |
| 63 | LOCAL_REQUIRED_MODULES_linux := libf2fs_fmt_host_dyn |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 64 | # The following libf2fs_* are from system/extras/f2fs_utils, |
| 65 | # and do not use code in external/f2fs-tools. |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 66 | 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] | 67 | |
Dan Willemsen | 87a419c | 2015-08-13 14:43:34 -0700 | [diff] [blame] | 68 | LOCAL_CXX_STL := libc++_static |
Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 69 | |
| 70 | # Don't add anything here, we don't want additional shared dependencies |
| 71 | # on the host fastboot tool, and shared libraries that link against libc++ |
| 72 | # will violate ODR |
| 73 | LOCAL_SHARED_LIBRARIES := |
| 74 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | include $(BUILD_HOST_EXECUTABLE) |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 76 | |
Ying Wang | 6b048ce | 2014-06-19 14:15:03 -0700 | [diff] [blame] | 77 | my_dist_files := $(LOCAL_BUILT_MODULE) |
| 78 | ifeq ($(HOST_OS),linux) |
| 79 | my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX) |
| 80 | endif |
| 81 | $(call dist-for-goals,dist_files sdk,$(my_dist_files)) |
| 82 | my_dist_files := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 83 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 84 | ifeq ($(HOST_OS),linux) |
| 85 | include $(CLEAR_VARS) |
Elliott Hughes | b3748de | 2015-06-23 20:27:58 -0700 | [diff] [blame] | 86 | 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] | 87 | LOCAL_MODULE := usbtest |
Mark Salyzyn | 5957c1f | 2014-04-30 14:05:28 -0700 | [diff] [blame] | 88 | LOCAL_CFLAGS := -Werror |
David Pursell | 0b15663 | 2015-10-30 11:22:01 -0700 | [diff] [blame] | 89 | LOCAL_STATIC_LIBRARIES := libbase |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 90 | include $(BUILD_HOST_EXECUTABLE) |
| 91 | endif |
David Pursell | 815c7be | 2015-12-09 17:09:54 -0800 | [diff] [blame^] | 92 | |
| 93 | # fastboot_test |
| 94 | # ========================================================= |
| 95 | include $(CLEAR_VARS) |
| 96 | |
| 97 | LOCAL_MODULE := fastboot_test |
| 98 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 99 | |
| 100 | LOCAL_SRC_FILES := socket_test.cpp |
| 101 | LOCAL_STATIC_LIBRARIES := libbase |
| 102 | |
| 103 | LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code |
| 104 | |
| 105 | LOCAL_SRC_FILES_linux := socket_unix.cpp |
| 106 | LOCAL_STATIC_LIBRARIES_linux := libcutils |
| 107 | |
| 108 | LOCAL_SRC_FILES_darwin := socket_unix.cpp |
| 109 | LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon |
| 110 | LOCAL_CFLAGS_darwin := -Wno-unused-parameter |
| 111 | LOCAL_STATIC_LIBRARIES_darwin := libcutils |
| 112 | |
| 113 | LOCAL_SRC_FILES_windows := socket_windows.cpp |
| 114 | LOCAL_LDLIBS_windows := -lws2_32 |
| 115 | |
| 116 | include $(BUILD_HOST_NATIVE_TEST) |