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_common_unittests := \
     29     bsdiff_unittest.cc \
     30     extents_file_unittest.cc \
     31     extents_unittest.cc \
     32     test_utils.cc
     33 
     34 # "bsdiff" program.
     35 bsdiff_shared_libs := \
     36     libdivsufsort64 \
     37     libdivsufsort
     38 
     39 bsdiff_src_files := \
     40     bsdiff.cc
     41 
     42 # "bspatch" program.
     43 bspatch_src_files := \
     44     bspatch.cc \
     45     extents.cc \
     46     extents_file.cc \
     47     file.cc
     48 
     49 # Target executables.
     50 
     51 include $(CLEAR_VARS)
     52 LOCAL_MODULE := bspatch
     53 LOCAL_CPP_EXTENSION := .cc
     54 LOCAL_SRC_FILES := \
     55     $(bspatch_src_files) \
     56     bspatch_main.cc
     57 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     58 LOCAL_C_INCLUDES += external/bzip2
     59 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
     60 include $(BUILD_EXECUTABLE)
     61 
     62 
     63 # Host executables.
     64 
     65 include $(CLEAR_VARS)
     66 LOCAL_MODULE := bsdiff
     67 LOCAL_CPP_EXTENSION := .cc
     68 LOCAL_SRC_FILES := \
     69     $(bsdiff_src_files) \
     70     bsdiff_main.cc
     71 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     72 LOCAL_C_INCLUDES += external/bzip2
     73 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
     74 LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
     75 include $(BUILD_HOST_EXECUTABLE)
     76 
     77 include $(CLEAR_VARS)
     78 LOCAL_MODULE := bspatch
     79 LOCAL_CPP_EXTENSION := .cc
     80 LOCAL_SRC_FILES := \
     81     $(bspatch_src_files) \
     82     bspatch_main.cc
     83 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     84 LOCAL_C_INCLUDES += external/bzip2
     85 LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
     86 include $(BUILD_HOST_EXECUTABLE)
     87 
     88 include $(CLEAR_VARS)
     89 LOCAL_MODULE := bsdiff_unittest
     90 LOCAL_MODULE_TAGS := debug tests
     91 LOCAL_CPP_EXTENSION := .cc
     92 LOCAL_SRC_FILES := \
     93     $(bsdiff_src_files) \
     94     $(bspatch_src_files) \
     95     $(bsdiff_common_unittests) \
     96     testrunner.cc
     97 LOCAL_CFLAGS := $(bsdiff_common_cflags)
     98 LOCAL_C_INCLUDES += external/bzip2
     99 LOCAL_STATIC_LIBRARIES := \
    100     $(bsdiff_common_static_libs) \
    101     libgtest_host \
    102     libgmock_host
    103 LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
    104 include $(BUILD_HOST_EXECUTABLE)
    105