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 | |
| 17 | include $(CLEAR_VARS) |
| 18 | |
Anatol Pomazau | c8ba536 | 2011-12-15 17:50:18 -0800 | [diff] [blame] | 19 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \ |
JP Abgrall | 1235158 | 2014-06-17 17:01:14 -0700 | [diff] [blame] | 20 | $(LOCAL_PATH)/../../extras/ext4_utils \ |
| 21 | $(LOCAL_PATH)/../../extras/f2fs_utils |
Elliott Hughes | 253c18d | 2015-03-18 22:47:09 -0700 | [diff] [blame] | 22 | LOCAL_SRC_FILES := protocol.c engine.c bootimg_utils.cpp fastboot.cpp util.c fs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 23 | LOCAL_MODULE := fastboot |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 24 | LOCAL_MODULE_TAGS := debug |
Elliott Hughes | 253c18d | 2015-03-18 22:47:09 -0700 | [diff] [blame] | 25 | LOCAL_CONLYFLAGS += -std=gnu99 |
Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 26 | LOCAL_CFLAGS += -Wall -Wextra -Werror |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 27 | |
| 28 | ifeq ($(HOST_OS),linux) |
| 29 | LOCAL_SRC_FILES += usb_linux.c util_linux.c |
| 30 | endif |
| 31 | |
| 32 | ifeq ($(HOST_OS),darwin) |
| 33 | LOCAL_SRC_FILES += usb_osx.c util_osx.c |
| 34 | LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \ |
| 35 | -framework Carbon |
Tim Murray | bd87944 | 2014-07-24 19:27:37 -0700 | [diff] [blame] | 36 | LOCAL_CFLAGS += -Wno-unused-parameter |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 37 | endif |
| 38 | |
| 39 | ifeq ($(HOST_OS),windows) |
| 40 | LOCAL_SRC_FILES += usb_windows.c util_windows.c |
| 41 | EXTRA_STATIC_LIBS := AdbWinApi |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 42 | ifneq ($(strip $(USE_CYGWIN)),) |
| 43 | # Pure cygwin case |
| 44 | LOCAL_LDLIBS += -lpthread |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 45 | endif |
| 46 | ifneq ($(strip $(USE_MINGW)),) |
| 47 | # MinGW under Linux case |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 48 | LOCAL_LDLIBS += -lws2_32 |
| 49 | USE_SYSDEPS_WIN32 := 1 |
| 50 | endif |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 51 | LOCAL_C_INCLUDES += development/host/windows/usb/api |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 52 | endif |
| 53 | |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 54 | LOCAL_STATIC_LIBRARIES := \ |
| 55 | $(EXTRA_STATIC_LIBS) \ |
Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 56 | libziparchive-host \ |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 57 | libext4_utils_host \ |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 58 | libsparse_host \ |
Elliott Hughes | d30ad8a | 2015-03-18 23:12:44 -0700 | [diff] [blame] | 59 | libutils \ |
| 60 | liblog \ |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 61 | libz |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 62 | |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 63 | ifneq ($(HOST_OS),windows) |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 64 | LOCAL_STATIC_LIBRARIES += libselinux |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 65 | endif # HOST_OS != windows |
| 66 | |
Torne (Richard Coles) | 11d8ac2 | 2014-06-18 13:48:38 +0100 | [diff] [blame] | 67 | ifeq ($(HOST_OS),linux) |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 68 | # libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn") |
| 69 | LOCAL_CFLAGS += -DUSE_F2FS |
JP Abgrall | 436abeb | 2014-06-19 14:47:19 -0700 | [diff] [blame] | 70 | LOCAL_LDFLAGS += -ldl -rdynamic -Wl,-rpath,. |
JP Abgrall | 64c0ff2 | 2014-06-18 11:12:52 -0700 | [diff] [blame] | 71 | LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 72 | # The following libf2fs_* are from system/extras/f2fs_utils, |
| 73 | # and do not use code in external/f2fs-tools. |
JP Abgrall | 64c0ff2 | 2014-06-18 11:12:52 -0700 | [diff] [blame] | 74 | LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host |
JP Abgrall | 6bd72be | 2014-06-17 23:43:18 -0700 | [diff] [blame] | 75 | endif |
| 76 | |
Colin Cross | dc1e482 | 2015-04-20 12:36:50 -0700 | [diff] [blame] | 77 | # libc++ not available on windows yet |
| 78 | ifneq ($(HOST_OS),windows) |
| 79 | LOCAL_CXX_STL := libc++_static |
| 80 | endif |
Colin Cross | 55bf5f0 | 2015-04-16 16:21:44 -0700 | [diff] [blame] | 81 | |
| 82 | # Don't add anything here, we don't want additional shared dependencies |
| 83 | # on the host fastboot tool, and shared libraries that link against libc++ |
| 84 | # will violate ODR |
| 85 | LOCAL_SHARED_LIBRARIES := |
| 86 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 87 | include $(BUILD_HOST_EXECUTABLE) |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 88 | |
Ying Wang | 6b048ce | 2014-06-19 14:15:03 -0700 | [diff] [blame] | 89 | my_dist_files := $(LOCAL_BUILT_MODULE) |
| 90 | ifeq ($(HOST_OS),linux) |
| 91 | my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX) |
| 92 | endif |
| 93 | $(call dist-for-goals,dist_files sdk,$(my_dist_files)) |
| 94 | my_dist_files := |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 95 | |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 96 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 97 | ifeq ($(HOST_OS),linux) |
| 98 | include $(CLEAR_VARS) |
Mark Wachsler | 157b001 | 2013-10-02 09:35:38 -0400 | [diff] [blame] | 99 | LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 100 | LOCAL_MODULE := usbtest |
Mark Salyzyn | 5957c1f | 2014-04-30 14:05:28 -0700 | [diff] [blame] | 101 | LOCAL_CFLAGS := -Werror |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 102 | include $(BUILD_HOST_EXECUTABLE) |
| 103 | endif |
| 104 | |
| 105 | ifeq ($(HOST_OS),windows) |
| 106 | $(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll |
| 107 | endif |