Android.mk revision 436abebf8c7df9e528e534b3c8dab955449c055b
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 \ 21 $(LOCAL_PATH)/../../extras/f2fs_utils 22LOCAL_SRC_FILES := protocol.c engine.c bootimg.c fastboot.c util.c fs.c 23LOCAL_MODULE := fastboot 24LOCAL_MODULE_TAGS := debug 25LOCAL_CFLAGS += -std=gnu99 -Werror 26 27ifeq ($(HOST_OS),linux) 28 LOCAL_SRC_FILES += usb_linux.c util_linux.c 29endif 30 31ifeq ($(HOST_OS),darwin) 32 LOCAL_SRC_FILES += usb_osx.c util_osx.c 33 LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \ 34 -framework Carbon 35endif 36 37ifeq ($(HOST_OS),windows) 38 LOCAL_SRC_FILES += usb_windows.c util_windows.c 39 EXTRA_STATIC_LIBS := AdbWinApi 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 47 LOCAL_LDLIBS += -lws2_32 48 USE_SYSDEPS_WIN32 := 1 49 LOCAL_C_INCLUDES += /usr/i586-mingw32msvc/include/ddk 50 endif 51 LOCAL_C_INCLUDES += development/host/windows/usb/api 52endif 53 54LOCAL_STATIC_LIBRARIES := \ 55 $(EXTRA_STATIC_LIBS) \ 56 libzipfile \ 57 libunz \ 58 libext4_utils_host \ 59 libsparse_host \ 60 libz 61 62ifneq ($(HOST_OS),windows) 63LOCAL_STATIC_LIBRARIES += libselinux 64endif # HOST_OS != windows 65 66ifeq ($(HOST_OS),linux) 67# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn") 68LOCAL_CFLAGS += -DUSE_F2FS 69LOCAL_LDFLAGS += -ldl -rdynamic -Wl,-rpath,. 70LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn 71# The following libf2fs_* are from system/extras/f2fs_utils, 72# and do not use code in external/f2fs-tools. 73LOCAL_STATIC_LIBRARIES += libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host 74endif 75 76include $(BUILD_HOST_EXECUTABLE) 77 78 79$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) 80 81 82ifeq ($(HOST_OS),linux) 83include $(CLEAR_VARS) 84LOCAL_SRC_FILES := usbtest.c usb_linux.c util.c 85LOCAL_MODULE := usbtest 86LOCAL_CFLAGS := -Werror 87include $(BUILD_HOST_EXECUTABLE) 88endif 89 90ifeq ($(HOST_OS),windows) 91$(LOCAL_INSTALLED_MODULE): $(HOST_OUT_EXECUTABLES)/AdbWinApi.dll 92endif 93