blob: b9b3c92ccfe5aa42cd0a113c3c9754efe888ab79 [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
Mark Wachsler157b0012013-10-02 09:35:38 -040021LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080022LOCAL_MODULE := fastboot
Kenny Rootd5d6d972012-09-26 09:58:07 -070023LOCAL_MODULE_TAGS := debug
Elliott Hughes14e28d32013-10-29 14:12:46 -070024LOCAL_CFLAGS += -std=gnu99
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080025
26ifeq ($(HOST_OS),linux)
27 LOCAL_SRC_FILES += usb_linux.c util_linux.c
28endif
29
30ifeq ($(HOST_OS),darwin)
31 LOCAL_SRC_FILES += usb_osx.c util_osx.c
32 LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \
33 -framework Carbon
34endif
35
36ifeq ($(HOST_OS),windows)
37 LOCAL_SRC_FILES += usb_windows.c util_windows.c
38 EXTRA_STATIC_LIBS := AdbWinApi
Raphaelfab16782010-04-13 15:25:50 -070039 ifneq ($(strip $(USE_CYGWIN)),)
40 # Pure cygwin case
41 LOCAL_LDLIBS += -lpthread
42 LOCAL_C_INCLUDES += /usr/include/w32api/ddk
43 endif
44 ifneq ($(strip $(USE_MINGW)),)
45 # MinGW under Linux case
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080046 LOCAL_LDLIBS += -lws2_32
47 USE_SYSDEPS_WIN32 := 1
Raphaelfab16782010-04-13 15:25:50 -070048 LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049 endif
Raphaelfab16782010-04-13 15:25:50 -070050 LOCAL_C_INCLUDES += development/host/windows/usb/api
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051endif
52
Joe Onorato2ffe3c82012-07-18 12:03:33 -070053LOCAL_STATIC_LIBRARIES := \
54 $(EXTRA_STATIC_LIBS) \
55 libzipfile \
56 libunz \
57 libext4_utils_host \
Joe Onorato5069b012012-07-23 19:15:14 -070058 libsparse_host \
Joe Onorato2ffe3c82012-07-18 12:03:33 -070059 libz
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080060
Kenny Root82fd6592012-04-08 11:25:04 -070061ifneq ($(HOST_OS),windows)
Kenny Root82fd6592012-04-08 11:25:04 -070062LOCAL_STATIC_LIBRARIES += libselinux
Kenny Root82fd6592012-04-08 11:25:04 -070063endif # HOST_OS != windows
64
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080065include $(BUILD_HOST_EXECUTABLE)
Joe Onorato5069b012012-07-23 19:15:14 -070066
67
Ying Wang96535ba2012-09-05 10:26:43 -070068$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080069
Joe Onorato5069b012012-07-23 19:15:14 -070070
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080071ifeq ($(HOST_OS),linux)
72include $(CLEAR_VARS)
Mark Wachsler157b0012013-10-02 09:35:38 -040073LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080074LOCAL_MODULE := usbtest
75include $(BUILD_HOST_EXECUTABLE)
76endif
77
78ifeq ($(HOST_OS),windows)
79$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll
80endif