Android.mk revision 157b00171a06f9ac2fd25ee3a86e801e896713d6
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
15LOCAL_PATH:= $(call my-dir)
16
17include $(CLEAR_VARS)
18
19LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \
20  $(LOCAL_PATH)/../../extras/ext4_utils
21LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c
22LOCAL_MODULE := fastboot
23LOCAL_MODULE_TAGS := debug
24
25ifeq ($(HOST_OS),linux)
26  LOCAL_SRC_FILES += usb_linux.c util_linux.c
27endif
28
29ifeq ($(HOST_OS),darwin)
30  LOCAL_SRC_FILES += usb_osx.c util_osx.c
31  LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \
32	-framework Carbon
33endif
34
35ifeq ($(HOST_OS),windows)
36  LOCAL_SRC_FILES += usb_windows.c util_windows.c
37  EXTRA_STATIC_LIBS := AdbWinApi
38  ifneq ($(strip $(USE_CYGWIN)),)
39    # Pure cygwin case
40    LOCAL_LDLIBS += -lpthread
41    LOCAL_C_INCLUDES += /usr/include/w32api/ddk
42  endif
43  ifneq ($(strip $(USE_MINGW)),)
44    # MinGW under Linux case
45    LOCAL_LDLIBS += -lws2_32
46    USE_SYSDEPS_WIN32 := 1
47    LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
48  endif
49  LOCAL_C_INCLUDES += development/host/windows/usb/api
50endif
51
52LOCAL_STATIC_LIBRARIES := \
53    $(EXTRA_STATIC_LIBS) \
54    libzipfile \
55    libunz \
56    libext4_utils_host \
57    libsparse_host \
58    libz
59
60ifneq ($(HOST_OS),windows)
61LOCAL_STATIC_LIBRARIES += libselinux
62endif # HOST_OS != windows
63
64include $(BUILD_HOST_EXECUTABLE)
65
66
67$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
68
69
70ifeq ($(HOST_OS),linux)
71include $(CLEAR_VARS)
72LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c
73LOCAL_MODULE := usbtest
74include $(BUILD_HOST_EXECUTABLE)
75endif
76
77ifeq ($(HOST_OS),windows)
78$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll
79endif
80