blob: 7b2975b7f969c19e8fbf57278db8aff600d51283 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001# 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
15LOCAL_PATH:= $(call my-dir)
16
17include $(CLEAR_VARS)
18
Anatol Pomazauc8ba5362011-12-15 17:50:18 -080019LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \
JP Abgrall12351582014-06-17 17:01:14 -070020 $(LOCAL_PATH)/../../extras/ext4_utils \
21 $(LOCAL_PATH)/../../extras/f2fs_utils
Elliott Hughes253c18d2015-03-18 22:47:09 -070022LOCAL_SRC_FILES := protocol.c engine.c bootimg_utils.cpp fastboot.cpp util.c fs.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080023LOCAL_MODULE := fastboot
Kenny Rootd5d6d972012-09-26 09:58:07 -070024LOCAL_MODULE_TAGS := debug
Elliott Hughes253c18d2015-03-18 22:47:09 -070025LOCAL_CONLYFLAGS += -std=gnu99
Elliott Hughesd30ad8a2015-03-18 23:12:44 -070026LOCAL_CFLAGS += -Wall -Wextra -Werror
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027
28ifeq ($(HOST_OS),linux)
29 LOCAL_SRC_FILES += usb_linux.c util_linux.c
30endif
31
32ifeq ($(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 Murraybd879442014-07-24 19:27:37 -070036 LOCAL_CFLAGS += -Wno-unused-parameter
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080037endif
38
39ifeq ($(HOST_OS),windows)
40 LOCAL_SRC_FILES += usb_windows.c util_windows.c
41 EXTRA_STATIC_LIBS := AdbWinApi
Raphaelfab16782010-04-13 15:25:50 -070042 ifneq ($(strip $(USE_CYGWIN)),)
43 # Pure cygwin case
44 LOCAL_LDLIBS += -lpthread
Raphaelfab16782010-04-13 15:25:50 -070045 endif
46 ifneq ($(strip $(USE_MINGW)),)
47 # MinGW under Linux case
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048 LOCAL_LDLIBS += -lws2_32
49 USE_SYSDEPS_WIN32 := 1
50 endif
Raphaelfab16782010-04-13 15:25:50 -070051 LOCAL_C_INCLUDES += development/host/windows/usb/api
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080052endif
53
Joe Onorato2ffe3c82012-07-18 12:03:33 -070054LOCAL_STATIC_LIBRARIES := \
55 $(EXTRA_STATIC_LIBS) \
Elliott Hughesd30ad8a2015-03-18 23:12:44 -070056 libziparchive-host \
Joe Onorato2ffe3c82012-07-18 12:03:33 -070057 libext4_utils_host \
Joe Onorato5069b012012-07-23 19:15:14 -070058 libsparse_host \
Elliott Hughesd30ad8a2015-03-18 23:12:44 -070059 libutils \
60 liblog \
Joe Onorato2ffe3c82012-07-18 12:03:33 -070061 libz
JP Abgrall6bd72be2014-06-17 23:43:18 -070062
Kenny Root82fd6592012-04-08 11:25:04 -070063ifneq ($(HOST_OS),windows)
Kenny Root82fd6592012-04-08 11:25:04 -070064LOCAL_STATIC_LIBRARIES += libselinux
Kenny Root82fd6592012-04-08 11:25:04 -070065endif # HOST_OS != windows
66
Torne (Richard Coles)11d8ac22014-06-18 13:48:38 +010067ifeq ($(HOST_OS),linux)
JP Abgrall6bd72be2014-06-17 23:43:18 -070068# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
69LOCAL_CFLAGS += -DUSE_F2FS
JP Abgrall436abeb2014-06-19 14:47:19 -070070LOCAL_LDFLAGS += -ldl -rdynamic -Wl,-rpath,.
JP Abgrall64c0ff22014-06-18 11:12:52 -070071LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn
JP Abgrall6bd72be2014-06-17 23:43:18 -070072# The following libf2fs_* are from system/extras/f2fs_utils,
73# and do not use code in external/f2fs-tools.
JP Abgrall64c0ff22014-06-18 11:12:52 -070074LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host
JP Abgrall6bd72be2014-06-17 23:43:18 -070075endif
76
Colin Crossdc1e4822015-04-20 12:36:50 -070077# libc++ not available on windows yet
78ifneq ($(HOST_OS),windows)
79 LOCAL_CXX_STL := libc++_static
80endif
Colin Cross55bf5f02015-04-16 16:21:44 -070081
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
85LOCAL_SHARED_LIBRARIES :=
86
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080087include $(BUILD_HOST_EXECUTABLE)
Joe Onorato5069b012012-07-23 19:15:14 -070088
Ying Wang6b048ce2014-06-19 14:15:03 -070089my_dist_files := $(LOCAL_BUILT_MODULE)
90ifeq ($(HOST_OS),linux)
91my_dist_files += $(HOST_LIBRARY_PATH)/libf2fs_fmt_host_dyn$(HOST_SHLIB_SUFFIX)
92endif
93$(call dist-for-goals,dist_files sdk,$(my_dist_files))
94my_dist_files :=
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080095
Joe Onorato5069b012012-07-23 19:15:14 -070096
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080097ifeq ($(HOST_OS),linux)
98include $(CLEAR_VARS)
Mark Wachsler157b0012013-10-02 09:35:38 -040099LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800100LOCAL_MODULE := usbtest
Mark Salyzyn5957c1f2014-04-30 14:05:28 -0700101LOCAL_CFLAGS := -Werror
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800102include $(BUILD_HOST_EXECUTABLE)
103endif
104
105ifeq ($(HOST_OS),windows)
106$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll
107endif