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