Home | History | Annotate | Download | only in fastboot
      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 
     15 LOCAL_PATH:= $(call my-dir)
     16 
     17 include $(LOCAL_PATH)/../platform_tools_tool_version.mk
     18 
     19 include $(CLEAR_VARS)
     20 
     21 LOCAL_CFLAGS += -DFASTBOOT_VERSION="\"$(tool_version)\""
     22 
     23 LOCAL_C_INCLUDES := \
     24   $(LOCAL_PATH)/../adb \
     25 
     26 LOCAL_HEADER_LIBRARIES := bootimg_headers
     27 
     28 LOCAL_SRC_FILES := \
     29     bootimg_utils.cpp \
     30     engine.cpp \
     31     fastboot.cpp \
     32     fs.cpp\
     33     protocol.cpp \
     34     socket.cpp \
     35     tcp.cpp \
     36     udp.cpp \
     37     util.cpp \
     38 
     39 LOCAL_MODULE := fastboot
     40 LOCAL_MODULE_TAGS := debug
     41 LOCAL_MODULE_HOST_OS := darwin linux windows
     42 LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
     43 LOCAL_REQUIRED_MODULES := mke2fs make_f2fs
     44 
     45 LOCAL_SRC_FILES_linux := usb_linux.cpp
     46 LOCAL_STATIC_LIBRARIES_linux := libselinux
     47 LOCAL_REQUIRED_MODULES_linux := e2fsdroid mke2fs.conf sload_f2fs
     48 
     49 LOCAL_SRC_FILES_darwin := usb_osx.cpp
     50 LOCAL_STATIC_LIBRARIES_darwin := libselinux
     51 LOCAL_REQUIRED_MODULES_darwin := e2fsdroid mke2fs.conf sload_f2fs
     52 LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
     53 LOCAL_CFLAGS_darwin := -Wno-unused-parameter
     54 
     55 LOCAL_SRC_FILES_windows := usb_windows.cpp
     56 LOCAL_SHARED_LIBRARIES_windows := AdbWinApi
     57 LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi
     58 LOCAL_LDLIBS_windows := -lws2_32
     59 LOCAL_C_INCLUDES_windows := development/host/windows/usb/api
     60 
     61 LOCAL_STATIC_LIBRARIES := \
     62     libziparchive \
     63     libsparse \
     64     libutils \
     65     liblog \
     66     libz \
     67     libdiagnose_usb \
     68     libbase \
     69     libcutils \
     70     libgtest_host \
     71 
     72 LOCAL_CXX_STL := libc++_static
     73 
     74 # Don't add anything here, we don't want additional shared dependencies
     75 # on the host fastboot tool, and shared libraries that link against libc++
     76 # will violate ODR
     77 LOCAL_SHARED_LIBRARIES :=
     78 
     79 include $(BUILD_HOST_EXECUTABLE)
     80 
     81 my_dist_files := $(LOCAL_BUILT_MODULE)
     82 my_dist_files += $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX)
     83 my_dist_files += $(HOST_OUT_EXECUTABLES)/e2fsdroid$(HOST_EXECUTABLE_SUFFIX)
     84 my_dist_files += $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX)
     85 my_dist_files += $(HOST_OUT_EXECUTABLES)/sload_f2fs$(HOST_EXECUTABLE_SUFFIX)
     86 $(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files))
     87 ifdef HOST_CROSS_OS
     88 # Archive fastboot.exe for win_sdk build.
     89 $(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_fastboot.BUILT))
     90 endif
     91 my_dist_files :=
     92 
     93 ifeq ($(HOST_OS),linux)
     94 include $(CLEAR_VARS)
     95 LOCAL_SRC_FILES := usbtest.cpp usb_linux.cpp util.cpp
     96 LOCAL_MODULE := usbtest
     97 LOCAL_CFLAGS := -Werror
     98 LOCAL_STATIC_LIBRARIES := libbase
     99 include $(BUILD_HOST_EXECUTABLE)
    100 endif
    101 
    102 # fastboot_test
    103 # =========================================================
    104 include $(CLEAR_VARS)
    105 
    106 LOCAL_MODULE := fastboot_test
    107 LOCAL_MODULE_HOST_OS := darwin linux windows
    108 
    109 LOCAL_SRC_FILES := \
    110     socket.cpp \
    111     socket_mock.cpp \
    112     socket_test.cpp \
    113     tcp.cpp \
    114     tcp_test.cpp \
    115     udp.cpp \
    116     udp_test.cpp \
    117 
    118 LOCAL_STATIC_LIBRARIES := libbase libcutils
    119 
    120 LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
    121 
    122 LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
    123 LOCAL_CFLAGS_darwin := -Wno-unused-parameter
    124 
    125 LOCAL_LDLIBS_windows := -lws2_32
    126 
    127 include $(BUILD_HOST_NATIVE_TEST)
    128