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 \ |
| 20 | $(LOCAL_PATH)/../../extras/ext4_utils |
Dmitry Grinberg | e6f3e9b | 2014-03-11 18:28:15 -0700 | [diff] [blame] | 21 | LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c fs.c |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 22 | LOCAL_MODULE := fastboot |
Kenny Root | d5d6d97 | 2012-09-26 09:58:07 -0700 | [diff] [blame] | 23 | LOCAL_MODULE_TAGS := debug |
Mark Salyzyn | 5957c1f | 2014-04-30 14:05:28 -0700 | [diff] [blame] | 24 | LOCAL_CFLAGS += -std=gnu99 -Werror |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 25 | |
| 26 | ifeq ($(HOST_OS),linux) |
| 27 | LOCAL_SRC_FILES += usb_linux.c util_linux.c |
| 28 | endif |
| 29 | |
| 30 | ifeq ($(HOST_OS),darwin) |
| 31 | LOCAL_SRC_FILES += usb_osx.c util_osx.c |
| 32 | LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \ |
| 33 | -framework Carbon |
Tim Murray | bd87944 | 2014-07-24 19:27:37 -0700 | [diff] [blame] | 34 | LOCAL_CFLAGS += -Wno-unused-parameter |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 35 | endif |
| 36 | |
| 37 | ifeq ($(HOST_OS),windows) |
| 38 | LOCAL_SRC_FILES += usb_windows.c util_windows.c |
| 39 | EXTRA_STATIC_LIBS := AdbWinApi |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 40 | ifneq ($(strip $(USE_CYGWIN)),) |
| 41 | # Pure cygwin case |
| 42 | LOCAL_LDLIBS += -lpthread |
| 43 | LOCAL_C_INCLUDES += /usr/include/w32api/ddk |
| 44 | endif |
| 45 | ifneq ($(strip $(USE_MINGW)),) |
| 46 | # MinGW under Linux case |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 47 | LOCAL_LDLIBS += -lws2_32 |
| 48 | USE_SYSDEPS_WIN32 := 1 |
Raphael | fab1678 | 2010-04-13 15:25:50 -0700 | [diff] [blame] | 49 | LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 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) \ |
| 56 | libzipfile \ |
| 57 | libunz \ |
| 58 | libext4_utils_host \ |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 59 | libsparse_host \ |
Joe Onorato | 2ffe3c8 | 2012-07-18 12:03:33 -0700 | [diff] [blame] | 60 | libz |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 61 | |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 62 | ifneq ($(HOST_OS),windows) |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 63 | LOCAL_STATIC_LIBRARIES += libselinux |
Kenny Root | 82fd659 | 2012-04-08 11:25:04 -0700 | [diff] [blame] | 64 | endif # HOST_OS != windows |
| 65 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 66 | include $(BUILD_HOST_EXECUTABLE) |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 67 | |
| 68 | |
Ying Wang | 96535ba | 2012-09-05 10:26:43 -0700 | [diff] [blame] | 69 | $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | |
Joe Onorato | 5069b01 | 2012-07-23 19:15:14 -0700 | [diff] [blame] | 71 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 72 | ifeq ($(HOST_OS),linux) |
| 73 | include $(CLEAR_VARS) |
Mark Wachsler | 157b001 | 2013-10-02 09:35:38 -0400 | [diff] [blame] | 74 | 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] | 75 | LOCAL_MODULE := usbtest |
Mark Salyzyn | 5957c1f | 2014-04-30 14:05:28 -0700 | [diff] [blame] | 76 | LOCAL_CFLAGS := -Werror |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 77 | include $(BUILD_HOST_EXECUTABLE) |
| 78 | endif |
| 79 | |
| 80 | ifeq ($(HOST_OS),windows) |
| 81 | $(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll |
| 82 | endif |