blob: 089b9bb617543fbb3f2afc6b7b84e4f25dcaa38a [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 \
20 $(LOCAL_PATH)/../../extras/ext4_utils
21LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080022LOCAL_MODULE := fastboot
23
24ifeq ($(HOST_OS),linux)
25 LOCAL_SRC_FILES += usb_linux.c util_linux.c
26endif
27
28ifeq ($(HOST_OS),darwin)
29 LOCAL_SRC_FILES += usb_osx.c util_osx.c
30 LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \
31 -framework Carbon
32endif
33
34ifeq ($(HOST_OS),windows)
35 LOCAL_SRC_FILES += usb_windows.c util_windows.c
36 EXTRA_STATIC_LIBS := AdbWinApi
Raphaelfab16782010-04-13 15:25:50 -070037 ifneq ($(strip $(USE_CYGWIN)),)
38 # Pure cygwin case
39 LOCAL_LDLIBS += -lpthread
40 LOCAL_C_INCLUDES += /usr/include/w32api/ddk
41 endif
42 ifneq ($(strip $(USE_MINGW)),)
43 # MinGW under Linux case
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080044 LOCAL_LDLIBS += -lws2_32
45 USE_SYSDEPS_WIN32 := 1
Raphaelfab16782010-04-13 15:25:50 -070046 LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047 endif
Raphaelfab16782010-04-13 15:25:50 -070048 LOCAL_C_INCLUDES += development/host/windows/usb/api
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049endif
50
Anatol Pomazauc8ba5362011-12-15 17:50:18 -080051LOCAL_STATIC_LIBRARIES := $(EXTRA_STATIC_LIBS) libzipfile libunz libext4_utils libz
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080052
Kenny Root82fd6592012-04-08 11:25:04 -070053ifneq ($(HOST_OS),windows)
54ifeq ($(HAVE_SELINUX), true)
55LOCAL_STATIC_LIBRARIES += libselinux
56endif # HAVE_SELINUX
57endif # HOST_OS != windows
58
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080059include $(BUILD_HOST_EXECUTABLE)
Ying Wang1c061b92010-12-09 10:33:27 -080060$(call dist-for-goals,dist_files,$(LOCAL_BUILT_MODULE))
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080061
62ifeq ($(HOST_OS),linux)
63include $(CLEAR_VARS)
64LOCAL_SRC_FILES := usbtest.c usb_linux.c
65LOCAL_MODULE := usbtest
66include $(BUILD_HOST_EXECUTABLE)
67endif
68
69ifeq ($(HOST_OS),windows)
70$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll
71endif