Android.mk revision 5957c1ffe79b34d8b1859f9f11644d1007193cbc
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 fs.c
22LOCAL_MODULE := fastboot
23LOCAL_MODULE_TAGS := debug
24LOCAL_CFLAGS += -std=gnu99 -Werror
25
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
39  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
46    LOCAL_LDLIBS += -lws2_32
47    USE_SYSDEPS_WIN32 := 1
48    LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk
49  endif
50  LOCAL_C_INCLUDES += development/host/windows/usb/api
51endif
52
53LOCAL_STATIC_LIBRARIES := \
54    $(EXTRA_STATIC_LIBS) \
55    libzipfile \
56    libunz \
57    libext4_utils_host \
58    libsparse_host \
59    libz
60
61ifneq ($(HOST_OS),windows)
62LOCAL_STATIC_LIBRARIES += libselinux
63endif # HOST_OS != windows
64
65include $(BUILD_HOST_EXECUTABLE)
66
67
68$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
69
70
71ifeq ($(HOST_OS),linux)
72include $(CLEAR_VARS)
73LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c
74LOCAL_MODULE := usbtest
75LOCAL_CFLAGS := -Werror
76include $(BUILD_HOST_EXECUTABLE)
77endif
78
79ifeq ($(HOST_OS),windows)
80$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll
81endif
82