blob: 44112fde4718b45bfa2dce7ad5577374e4a81510 [file] [log] [blame]
Doug Zongker512536a2010-02-17 16:11:44 -08001# 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
Doug Zongker512536a2010-02-17 16:11:44 -080015LOCAL_PATH := $(call my-dir)
Tao Bao80e46e02015-06-03 10:49:29 -070016
Tao Baod80a9982016-03-03 11:43:47 -080017# libapplypatch (static library)
18# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -080019include $(CLEAR_VARS)
Tao Baod80a9982016-03-03 11:43:47 -080020LOCAL_SRC_FILES := \
21 applypatch.cpp \
22 bspatch.cpp \
23 freecache.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -080024 imgpatch.cpp
Doug Zongker512536a2010-02-17 16:11:44 -080025LOCAL_MODULE := libapplypatch
bigbiffd58ba182020-03-23 10:02:29 -040026LOCAL_MODULE_TAGS := optional
Tao Bao97555da2016-12-15 10:15:06 -080027LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -080028 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050029 $(commands_recovery_local_path)
Michael Bestas608d5662018-01-10 18:30:37 +020030LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -080031LOCAL_STATIC_LIBRARIES := \
Tao Baod80a9982016-03-03 11:43:47 -080032 libotafault \
Tao Baod80a9982016-03-03 11:43:47 -080033 libbase \
Josh Gao073164f2016-08-05 15:59:05 -070034 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -070035 libbspatch \
Tao Baod80a9982016-03-03 11:43:47 -080036 libbz \
37 libz
Ethan Yonker8373cfe2017-09-08 06:50:54 -050038LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils
Tao Bao087bc0c2017-01-19 10:46:39 -080039LOCAL_CFLAGS := \
40 -DZLIB_CONST \
41 -Werror
Michael Bestas608d5662018-01-10 18:30:37 +020042
43BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY
44
45$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
46 $(if $($(board_define)), \
47 $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \
48 ) \
49 )
50
Doug Zongker512536a2010-02-17 16:11:44 -080051include $(BUILD_STATIC_LIBRARY)
52
Tao Baod80a9982016-03-03 11:43:47 -080053# libimgpatch (static library)
54# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -080055include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -080056LOCAL_SRC_FILES := \
57 bspatch.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -080058 imgpatch.cpp
Sen Jiang0cce9cd2016-01-22 20:49:07 +080059LOCAL_MODULE := libimgpatch
Tao Bao97555da2016-12-15 10:15:06 -080060LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -080061 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050062 $(commands_recovery_local_path)
Sen Jiang0cce9cd2016-01-22 20:49:07 +080063LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -080064LOCAL_STATIC_LIBRARIES := \
65 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -070066 libbspatch \
Tianjie Xu12b90552017-03-07 14:44:14 -080067 libbase \
Tao Bao97555da2016-12-15 10:15:06 -080068 libbz \
69 libz
Tao Bao087bc0c2017-01-19 10:46:39 -080070LOCAL_CFLAGS := \
71 -DZLIB_CONST \
72 -Werror
Sen Jiang0cce9cd2016-01-22 20:49:07 +080073include $(BUILD_STATIC_LIBRARY)
Sen Jiang0cce9cd2016-01-22 20:49:07 +080074
Tao Baod80a9982016-03-03 11:43:47 -080075# libimgpatch (host static library)
76# ===============================
Sen Jiang0cce9cd2016-01-22 20:49:07 +080077include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -080078LOCAL_SRC_FILES := \
79 bspatch.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -080080 imgpatch.cpp
Sen Jiang0cce9cd2016-01-22 20:49:07 +080081LOCAL_MODULE := libimgpatch
Tao Baod80a9982016-03-03 11:43:47 -080082LOCAL_MODULE_HOST_OS := linux
Tao Bao97555da2016-12-15 10:15:06 -080083LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -080084 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050085 $(commands_recovery_local_path)
Sen Jiang0cce9cd2016-01-22 20:49:07 +080086LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -080087LOCAL_STATIC_LIBRARIES := \
88 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -070089 libbspatch \
Tianjie Xu12b90552017-03-07 14:44:14 -080090 libbase \
Tao Bao97555da2016-12-15 10:15:06 -080091 libbz \
92 libz
Tao Bao087bc0c2017-01-19 10:46:39 -080093LOCAL_CFLAGS := \
94 -DZLIB_CONST \
95 -Werror
Sen Jiang0cce9cd2016-01-22 20:49:07 +080096include $(BUILD_HOST_STATIC_LIBRARY)
97
Tao Bao36c35112016-10-25 14:17:26 -070098# libapplypatch_modes (static library)
Tao Baod80a9982016-03-03 11:43:47 -080099# ===============================
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800100include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -0700101LOCAL_SRC_FILES := \
102 applypatch_modes.cpp
103LOCAL_MODULE := libapplypatch_modes
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500104LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Tao Bao36c35112016-10-25 14:17:26 -0700105LOCAL_STATIC_LIBRARIES := \
106 libapplypatch \
107 libbase \
108 libedify \
109 libcrypto
110LOCAL_CFLAGS := -Werror
111include $(BUILD_STATIC_LIBRARY)
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800112
Tao Bao36c35112016-10-25 14:17:26 -0700113# applypatch (target executable)
114# ===============================
115include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -0700116LOCAL_SRC_FILES := applypatch_main.cpp
Doug Zongker512536a2010-02-17 16:11:44 -0800117LOCAL_MODULE := applypatch
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500118LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Tao Bao36c35112016-10-25 14:17:26 -0700119LOCAL_STATIC_LIBRARIES := \
120 libapplypatch_modes \
Tao Baod80a9982016-03-03 11:43:47 -0800121 libapplypatch \
122 libbase \
123 libedify \
124 libotafault \
Josh Gao073164f2016-08-05 15:59:05 -0700125 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -0700126 libbspatch \
Tao Baod80a9982016-03-03 11:43:47 -0800127 libbz
Tao Bao36c35112016-10-25 14:17:26 -0700128LOCAL_SHARED_LIBRARIES := \
129 libbase \
130 libz \
131 libcutils
Tianjie Xu7aa88742016-09-28 11:42:17 -0700132LOCAL_CFLAGS := -Werror
Doug Zongker512536a2010-02-17 16:11:44 -0800133include $(BUILD_EXECUTABLE)
134
Tianjie Xu12b90552017-03-07 14:44:14 -0800135libimgdiff_src_files := imgdiff.cpp
Tao Bao97555da2016-12-15 10:15:06 -0800136
137# libbsdiff is compiled with -D_FILE_OFFSET_BITS=64.
138libimgdiff_cflags := \
139 -Werror \
140 -D_FILE_OFFSET_BITS=64
141
142libimgdiff_static_libraries := \
143 libbsdiff \
Sen Jiang930edb62017-01-18 17:26:42 -0800144 libdivsufsort \
145 libdivsufsort64 \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800146 libziparchive \
147 libutils \
148 liblog \
Tao Baod37ce8f2016-12-17 17:10:04 -0800149 libbase \
Tao Bao97555da2016-12-15 10:15:06 -0800150 libz
151
152# libimgdiff (static library)
153# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -0800154include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -0800155LOCAL_SRC_FILES := \
156 $(libimgdiff_src_files)
157LOCAL_MODULE := libimgdiff
158LOCAL_CFLAGS := \
159 $(libimgdiff_cflags)
160LOCAL_STATIC_LIBRARIES := \
161 $(libimgdiff_static_libraries)
162LOCAL_C_INCLUDES := \
163 $(LOCAL_PATH)/include
164LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
165include $(BUILD_STATIC_LIBRARY)
Doug Zongker512536a2010-02-17 16:11:44 -0800166
Tao Bao97555da2016-12-15 10:15:06 -0800167# libimgdiff (host static library)
168# ===============================
169include $(CLEAR_VARS)
170LOCAL_SRC_FILES := \
171 $(libimgdiff_src_files)
172LOCAL_MODULE := libimgdiff
173LOCAL_CFLAGS := \
174 $(libimgdiff_cflags)
175LOCAL_STATIC_LIBRARIES := \
176 $(libimgdiff_static_libraries)
177LOCAL_C_INCLUDES := \
178 $(LOCAL_PATH)/include
179LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
180include $(BUILD_HOST_STATIC_LIBRARY)
181
Tao Baod80a9982016-03-03 11:43:47 -0800182# imgdiff (host static executable)
183# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -0800184include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -0800185LOCAL_SRC_FILES := imgdiff_main.cpp
Doug Zongker512536a2010-02-17 16:11:44 -0800186LOCAL_MODULE := imgdiff
Tianjie Xu7aa88742016-09-28 11:42:17 -0700187LOCAL_CFLAGS := -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800188LOCAL_STATIC_LIBRARIES := \
189 libimgdiff \
190 $(libimgdiff_static_libraries) \
Sen Jiang930edb62017-01-18 17:26:42 -0800191 libbz
Doug Zongker512536a2010-02-17 16:11:44 -0800192include $(BUILD_HOST_EXECUTABLE)