1# Copyright (C) 2008 The Android Open Source Project 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 17# Common project flags. 18bsdiff_common_cflags := \ 19 -D_FILE_OFFSET_BITS=64 \ 20 -Wall \ 21 -Werror \ 22 -Wextra \ 23 -Wno-unused-parameter 24 25bsdiff_common_static_libs := \ 26 libbz 27 28# "bsdiff" program. 29bsdiff_static_libs := \ 30 libdivsufsort64 \ 31 libdivsufsort \ 32 $(bsdiff_common_static_libs) 33 34bsdiff_src_files := \ 35 bsdiff.cc 36 37# "bspatch" program. 38bspatch_src_files := \ 39 bspatch.cc \ 40 buffer_file.cc \ 41 extents.cc \ 42 extents_file.cc \ 43 file.cc \ 44 memory_file.cc \ 45 sink_file.cc 46 47# Unit test files. 48bsdiff_common_unittests := \ 49 bsdiff_unittest.cc \ 50 bspatch_unittest.cc \ 51 extents_file_unittest.cc \ 52 extents_unittest.cc \ 53 test_utils.cc 54 55# Target static libraries. 56 57include $(CLEAR_VARS) 58LOCAL_MODULE := libbspatch 59LOCAL_CPP_EXTENSION := .cc 60LOCAL_SRC_FILES := $(bspatch_src_files) 61LOCAL_CFLAGS := $(bsdiff_common_cflags) 62LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 63LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs) 64include $(BUILD_STATIC_LIBRARY) 65 66include $(CLEAR_VARS) 67LOCAL_MODULE := libbsdiff 68LOCAL_CPP_EXTENSION := .cc 69LOCAL_SRC_FILES := $(bsdiff_src_files) 70LOCAL_CFLAGS := $(bsdiff_common_cflags) 71LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 72LOCAL_STATIC_LIBRARIES := $(bsdiff_static_libs) 73include $(BUILD_STATIC_LIBRARY) 74 75# Host static libraries. 76 77include $(CLEAR_VARS) 78LOCAL_MODULE := libbspatch 79LOCAL_CPP_EXTENSION := .cc 80LOCAL_SRC_FILES := $(bspatch_src_files) 81LOCAL_CFLAGS := $(bsdiff_common_cflags) 82LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 83LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs) 84include $(BUILD_HOST_STATIC_LIBRARY) 85 86include $(CLEAR_VARS) 87LOCAL_MODULE := libbsdiff 88LOCAL_CPP_EXTENSION := .cc 89LOCAL_SRC_FILES := $(bsdiff_src_files) 90LOCAL_CFLAGS := $(bsdiff_common_cflags) 91LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 92LOCAL_STATIC_LIBRARIES := $(bsdiff_static_libs) 93include $(BUILD_HOST_STATIC_LIBRARY) 94 95# Target executables. 96 97include $(CLEAR_VARS) 98LOCAL_MODULE := bspatch 99LOCAL_CPP_EXTENSION := .cc 100LOCAL_SRC_FILES := bspatch_main.cc 101LOCAL_CFLAGS := $(bsdiff_common_cflags) 102LOCAL_STATIC_LIBRARIES := \ 103 libbspatch \ 104 $(bsdiff_common_static_libs) 105include $(BUILD_EXECUTABLE) 106 107# Host executables. 108 109include $(CLEAR_VARS) 110LOCAL_MODULE := bsdiff 111LOCAL_CPP_EXTENSION := .cc 112LOCAL_SRC_FILES := bsdiff_main.cc 113LOCAL_CFLAGS := $(bsdiff_common_cflags) 114LOCAL_STATIC_LIBRARIES := \ 115 libbsdiff \ 116 $(bsdiff_static_libs) 117include $(BUILD_HOST_EXECUTABLE) 118 119include $(CLEAR_VARS) 120LOCAL_MODULE := bspatch 121LOCAL_CPP_EXTENSION := .cc 122LOCAL_SRC_FILES := bspatch_main.cc 123LOCAL_CFLAGS := $(bsdiff_common_cflags) 124LOCAL_STATIC_LIBRARIES := \ 125 libbspatch \ 126 $(bsdiff_common_static_libs) 127include $(BUILD_HOST_EXECUTABLE) 128 129# Unit tests. 130 131include $(CLEAR_VARS) 132LOCAL_MODULE := bsdiff_unittest 133LOCAL_MODULE_TAGS := debug tests 134LOCAL_CPP_EXTENSION := .cc 135LOCAL_SRC_FILES := $(bsdiff_common_unittests) \ 136 testrunner.cc 137LOCAL_CFLAGS := $(bsdiff_common_cflags) \ 138 -DBSDIFF_TARGET_UNITTEST 139LOCAL_STATIC_LIBRARIES := \ 140 libbsdiff \ 141 libbspatch \ 142 libgmock \ 143 $(bsdiff_static_libs) 144include $(BUILD_NATIVE_TEST) 145