• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_shared_libs := \
30    libdivsufsort64 \
31    libdivsufsort
32
33bsdiff_src_files := \
34    bsdiff.cc
35
36# "bspatch" program.
37bspatch_src_files := \
38    bspatch.cc \
39    extents.cc \
40    extents_file.cc \
41    file.cc \
42    memory_file.cc
43
44# Unit test files.
45bsdiff_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
54include $(CLEAR_VARS)
55LOCAL_MODULE := bspatch
56LOCAL_CPP_EXTENSION := .cc
57LOCAL_SRC_FILES := \
58    $(bspatch_src_files) \
59    bspatch_main.cc
60LOCAL_CFLAGS := $(bsdiff_common_cflags)
61LOCAL_C_INCLUDES += external/bzip2
62LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
63include $(BUILD_EXECUTABLE)
64
65# bspatch used in recovery by update_engine_sideload.
66include $(CLEAR_VARS)
67LOCAL_MODULE := bspatch_recovery
68LOCAL_MODULE_STEM := bspatch
69LOCAL_FORCE_STATIC_EXECUTABLE := true
70LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
71LOCAL_CPP_EXTENSION := .cc
72LOCAL_SRC_FILES := \
73    $(bspatch_src_files) \
74    bspatch_main.cc
75LOCAL_CFLAGS := $(bsdiff_common_cflags)
76LOCAL_STATIC_LIBRARIES := \
77    $(bsdiff_common_static_libs)
78include $(BUILD_EXECUTABLE)
79
80# Host executables.
81
82include $(CLEAR_VARS)
83LOCAL_MODULE := bsdiff
84LOCAL_CPP_EXTENSION := .cc
85LOCAL_SRC_FILES := \
86    $(bsdiff_src_files) \
87    bsdiff_main.cc
88LOCAL_CFLAGS := $(bsdiff_common_cflags)
89LOCAL_C_INCLUDES += external/bzip2
90LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
91LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
92include $(BUILD_HOST_EXECUTABLE)
93
94include $(CLEAR_VARS)
95LOCAL_MODULE := bspatch
96LOCAL_CPP_EXTENSION := .cc
97LOCAL_SRC_FILES := \
98    $(bspatch_src_files) \
99    bspatch_main.cc
100LOCAL_CFLAGS := $(bsdiff_common_cflags)
101LOCAL_C_INCLUDES += external/bzip2
102LOCAL_STATIC_LIBRARIES := $(bsdiff_common_static_libs)
103include $(BUILD_HOST_EXECUTABLE)
104
105include $(CLEAR_VARS)
106LOCAL_MODULE := bsdiff_unittest
107LOCAL_MODULE_TAGS := debug tests
108LOCAL_CPP_EXTENSION := .cc
109LOCAL_SRC_FILES := \
110    $(bsdiff_src_files) \
111    $(bspatch_src_files) \
112    $(bsdiff_common_unittests) \
113    testrunner.cc
114LOCAL_CFLAGS := $(bsdiff_common_cflags)
115LOCAL_C_INCLUDES += external/bzip2
116LOCAL_STATIC_LIBRARIES := \
117    $(bsdiff_common_static_libs) \
118    libgtest_host \
119    libgmock_host
120LOCAL_SHARED_LIBRARIES := $(bsdiff_shared_libs)
121include $(BUILD_HOST_EXECUTABLE)
122