Home | History | Annotate | Download | only in bsdiff
      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 
     15 LOCAL_PATH := $(call my-dir)
     16 
     17 # Common project flags.
     18 bsdiff_common_cflags := \
     19     -D_FILE_OFFSET_BITS=64 \
     20     -Wall \
     21     -Werror \
     22     -Wextra \
     23     -Wno-unused-parameter
     24 
     25 bsdiff_common_static_libs := \
     26     libbz
     27 
     28 # "bsdiff" program.
     29 bsdiff_shared_libs := \
     30     libdivsufsort64 \
     31     libdivsufsort
     32 
     33 bsdiff_src_files := \
     34     bsdiff.cc
     35 
     36 # "bspatch" program.
     37 bspatch_src_files := \
     38     bspatch.cc \
     39     extents.cc \
     40     extents_file.cc \
     41     file.cc \
     42     memory_file.cc
     43 
     44 # Unit test files.
     45 bsdiff_common_unittests := \
     46     bsdiff_unittest.cc \
     47     bspatch_unittest.cc \
     48     extents_file_unittest.cc \
     49     extents_unittest.cc \
     50     test_utils.cc
     51 
     52 # Target executables.
     53 
     54 include $(CLEAR_VARS)
     55 LOCAL_MODULE := bspatch
     56 LOCAL_CPP_EXTENSION := .cc
     57 LOCAL_SRC_FILES := \
     58     $(bspatch_src_files) \
     59     bspatch_main.cc
     60 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     61 LOCAL_C_INCLUDES += external/bzip2
     62 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
     63 include $(BUILD_EXECUTABLE)
     64 
     65 # bspatch used in recovery by update_engine_sideload.
     66 include $(CLEAR_VARS)
     67 LOCAL_MODULE := bspatch_recovery
     68 LOCAL_MODULE_STEM := bspatch
     69 LOCAL_FORCE_STATIC_EXECUTABLE := true
     70 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
     71 LOCAL_CPP_EXTENSION := .cc
     72 LOCAL_SRC_FILES := \
     73     $(bspatch_src_files) \
     74     bspatch_main.cc
     75 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     76 LOCAL_STATIC_LIBRARIES := \
     77     $(bsdiff_common_static_libs)
     78 include $(BUILD_EXECUTABLE)
     79 
     80 # Host executables.
     81 
     82 include $(CLEAR_VARS)
     83 LOCAL_MODULE := bsdiff
     84 LOCAL_CPP_EXTENSION := .cc
     85 LOCAL_SRC_FILES := \
     86     $(bsdiff_src_files) \
     87     bsdiff_main.cc
     88 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     89 LOCAL_C_INCLUDES += external/bzip2
     90 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
     91 LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
     92 include $(BUILD_HOST_EXECUTABLE)
     93 
     94 include $(CLEAR_VARS)
     95 LOCAL_MODULE := bspatch
     96 LOCAL_CPP_EXTENSION := .cc
     97 LOCAL_SRC_FILES := \
     98     $(bspatch_src_files) \
     99     bspatch_main.cc
    100 LOCAL_CFLAGS := $(bsdiff_common_cflags)
    101 LOCAL_C_INCLUDES += external/bzip2
    102 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
    103 include $(BUILD_HOST_EXECUTABLE)
    104 
    105 include $(CLEAR_VARS)
    106 LOCAL_MODULE := bsdiff_unittest
    107 LOCAL_MODULE_TAGS := debug tests
    108 LOCAL_CPP_EXTENSION := .cc
    109 LOCAL_SRC_FILES := \
    110     $(bsdiff_src_files) \
    111     $(bspatch_src_files) \
    112     $(bsdiff_common_unittests) \
    113     testrunner.cc
    114 LOCAL_CFLAGS := $(bsdiff_common_cflags)
    115 LOCAL_C_INCLUDES += external/bzip2
    116 LOCAL_STATIC_LIBRARIES := \
    117     $(bsdiff_common_static_libs) \
    118     libgtest_host \
    119     libgmock_host
    120 LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
    121 include $(BUILD_HOST_EXECUTABLE)
    122