blob: 9cbe3e2a9d9175e1a0ea4aa69181201370101161 [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
Michael Bestasc86b6d42017-04-28 22:43:09 +030017ifdef project-path-for
18 RECOVERY_PATH := $(call project-path-for,recovery)
19else
20 RECOVERY_PATH := bootable/recovery
21endif
22
Doug Zongker512536a2010-02-17 16:11:44 -080023include $(CLEAR_VARS)
24
Conn O'Griofad9201042014-03-25 01:26:49 +000025BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY
26
27$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
28 $(if $($(board_define)), \
29 $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \
30 ) \
31 )
32
Matt Mower55c75ca2014-08-31 11:30:15 -050033LOCAL_C_INCLUDES += \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050034 $(LOCAL_PATH)/include \
Matt Mower55c75ca2014-08-31 11:30:15 -050035 external/bzip2 \
36 external/zlib \
37 $(commands_recovery_local_path)
Ethan Yonker34ae4832016-08-24 15:32:18 -050038
Tao Bao80e46e02015-06-03 10:49:29 -070039LOCAL_CLANG := true
Tao Baoba9a42a2015-06-23 23:23:33 -070040LOCAL_SRC_FILES := applypatch.cpp bspatch.cpp freecache.cpp imgpatch.cpp utils.cpp
Doug Zongker512536a2010-02-17 16:11:44 -080041LOCAL_MODULE := libapplypatch
42LOCAL_MODULE_TAGS := eng
Michael Bestasc86b6d42017-04-28 22:43:09 +030043LOCAL_C_INCLUDES += $(RECOVERY_PATH)
Ethan Yonkerb8e985c2016-08-31 13:42:11 -050044LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz
Doug Zongker512536a2010-02-17 16:11:44 -080045
Tao Baod80a9982016-03-03 11:43:47 -080046# libapplypatch (static library)
47# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -080048include $(CLEAR_VARS)
Tao Baod80a9982016-03-03 11:43:47 -080049LOCAL_SRC_FILES := \
50 applypatch.cpp \
51 bspatch.cpp \
52 freecache.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -080053 imgpatch.cpp
Doug Zongker512536a2010-02-17 16:11:44 -080054LOCAL_MODULE := libapplypatch
55LOCAL_MODULE_TAGS := eng
Ethan Yonker8373cfe2017-09-08 06:50:54 -050056LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -080057LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -080058 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050059 $(commands_recovery_local_path)
Tao Bao97555da2016-12-15 10:15:06 -080060LOCAL_STATIC_LIBRARIES := \
Tao Baod80a9982016-03-03 11:43:47 -080061 libotafault \
Tao Baod80a9982016-03-03 11:43:47 -080062 libbase \
Josh Gao073164f2016-08-05 15:59:05 -070063 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -070064 libbspatch \
Tao Baod80a9982016-03-03 11:43:47 -080065 libbz \
66 libz
Ethan Yonker8373cfe2017-09-08 06:50:54 -050067LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils
Tao Bao087bc0c2017-01-19 10:46:39 -080068LOCAL_CFLAGS := \
69 -DZLIB_CONST \
70 -Werror
Doug Zongker512536a2010-02-17 16:11:44 -080071include $(BUILD_STATIC_LIBRARY)
72
Tao Baod80a9982016-03-03 11:43:47 -080073# libimgpatch (static library)
74# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -080075include $(CLEAR_VARS)
76
Tao Bao97555da2016-12-15 10:15:06 -080077LOCAL_SRC_FILES := \
78 bspatch.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -080079 imgpatch.cpp
Sen Jiang0cce9cd2016-01-22 20:49:07 +080080LOCAL_MODULE := libimgpatch
Tao Bao97555da2016-12-15 10:15:06 -080081LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -080082 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -050083 $(commands_recovery_local_path)
Sen Jiang0cce9cd2016-01-22 20:49:07 +080084LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -080085LOCAL_STATIC_LIBRARIES := \
86 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -070087 libbspatch \
Tianjie Xu12b90552017-03-07 14:44:14 -080088 libbase \
Tao Bao97555da2016-12-15 10:15:06 -080089 libbz \
90 libz
Tao Bao087bc0c2017-01-19 10:46:39 -080091LOCAL_CFLAGS := \
92 -DZLIB_CONST \
93 -Werror
Sen Jiang0cce9cd2016-01-22 20:49:07 +080094include $(BUILD_STATIC_LIBRARY)
Sen Jiang0cce9cd2016-01-22 20:49:07 +080095
Tao Baod80a9982016-03-03 11:43:47 -080096# libimgpatch (host static library)
97# ===============================
Sen Jiang0cce9cd2016-01-22 20:49:07 +080098include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -080099LOCAL_SRC_FILES := \
100 bspatch.cpp \
Tianjie Xu12b90552017-03-07 14:44:14 -0800101 imgpatch.cpp
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800102LOCAL_MODULE := libimgpatch
Michael Bestasc86b6d42017-04-28 22:43:09 +0300103LOCAL_C_INCLUDES += $(RECOVERY_PATH)
Tao Baod80a9982016-03-03 11:43:47 -0800104LOCAL_MODULE_HOST_OS := linux
Tao Bao97555da2016-12-15 10:15:06 -0800105LOCAL_C_INCLUDES := \
Tao Baod80a9982016-03-03 11:43:47 -0800106 $(LOCAL_PATH)/include \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500107 $(commands_recovery_local_path)
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800108LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Tao Bao97555da2016-12-15 10:15:06 -0800109LOCAL_STATIC_LIBRARIES := \
110 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -0700111 libbspatch \
Tianjie Xu12b90552017-03-07 14:44:14 -0800112 libbase \
Tao Bao97555da2016-12-15 10:15:06 -0800113 libbz \
114 libz
Tao Bao087bc0c2017-01-19 10:46:39 -0800115LOCAL_CFLAGS := \
116 -DZLIB_CONST \
117 -Werror
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800118include $(BUILD_HOST_STATIC_LIBRARY)
119
Tao Bao36c35112016-10-25 14:17:26 -0700120# libapplypatch_modes (static library)
Tao Baod80a9982016-03-03 11:43:47 -0800121# ===============================
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800122include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -0700123LOCAL_SRC_FILES := \
124 applypatch_modes.cpp
125LOCAL_MODULE := libapplypatch_modes
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500126LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Tao Bao36c35112016-10-25 14:17:26 -0700127LOCAL_STATIC_LIBRARIES := \
128 libapplypatch \
129 libbase \
130 libedify \
131 libcrypto
132LOCAL_CFLAGS := -Werror
133include $(BUILD_STATIC_LIBRARY)
Sen Jiang0cce9cd2016-01-22 20:49:07 +0800134
Tao Bao36c35112016-10-25 14:17:26 -0700135# applypatch (target executable)
136# ===============================
137include $(CLEAR_VARS)
Tao Bao36c35112016-10-25 14:17:26 -0700138LOCAL_SRC_FILES := applypatch_main.cpp
Doug Zongker512536a2010-02-17 16:11:44 -0800139LOCAL_MODULE := applypatch
Michael Bestasc86b6d42017-04-28 22:43:09 +0300140LOCAL_C_INCLUDES += $(RECOVERY_PATH)
Yabin Cuica78c9f2016-02-05 15:27:52 -0800141LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \
142 libedify \
143
Dan Alberte49a9e52015-05-19 11:33:18 -0700144LOCAL_SHARED_LIBRARIES += libz libcutils libc
Doug Zongker512536a2010-02-17 16:11:44 -0800145
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500146LOCAL_C_INCLUDES := $(commands_recovery_local_path)
Tao Bao36c35112016-10-25 14:17:26 -0700147LOCAL_STATIC_LIBRARIES := \
148 libapplypatch_modes \
Tao Baod80a9982016-03-03 11:43:47 -0800149 libapplypatch \
150 libbase \
151 libedify \
152 libotafault \
Josh Gao073164f2016-08-05 15:59:05 -0700153 libcrypto \
Sen Jiang25c56972016-05-10 15:23:25 -0700154 libbspatch \
Tao Baod80a9982016-03-03 11:43:47 -0800155 libbz
Tao Bao36c35112016-10-25 14:17:26 -0700156LOCAL_SHARED_LIBRARIES := \
157 libbase \
158 libz \
159 libcutils
Tianjie Xu7aa88742016-09-28 11:42:17 -0700160LOCAL_CFLAGS := -Werror
Doug Zongker512536a2010-02-17 16:11:44 -0800161include $(BUILD_EXECUTABLE)
162
Tianjie Xu12b90552017-03-07 14:44:14 -0800163libimgdiff_src_files := imgdiff.cpp
Tao Bao97555da2016-12-15 10:15:06 -0800164
165# libbsdiff is compiled with -D_FILE_OFFSET_BITS=64.
166libimgdiff_cflags := \
167 -Werror \
168 -D_FILE_OFFSET_BITS=64
169
170libimgdiff_static_libraries := \
171 libbsdiff \
Sen Jiang930edb62017-01-18 17:26:42 -0800172 libdivsufsort \
173 libdivsufsort64 \
Tianjie Xu1ea84d62017-02-22 18:23:58 -0800174 libziparchive \
175 libutils \
176 liblog \
Tao Baod37ce8f2016-12-17 17:10:04 -0800177 libbase \
Tao Bao97555da2016-12-15 10:15:06 -0800178 libz
179
180# libimgdiff (static library)
181# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -0800182include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -0800183LOCAL_SRC_FILES := \
184 $(libimgdiff_src_files)
185LOCAL_MODULE := libimgdiff
186LOCAL_CFLAGS := \
187 $(libimgdiff_cflags)
188LOCAL_STATIC_LIBRARIES := \
189 $(libimgdiff_static_libraries)
190LOCAL_C_INCLUDES := \
191 $(LOCAL_PATH)/include
192LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
193include $(BUILD_STATIC_LIBRARY)
Doug Zongker512536a2010-02-17 16:11:44 -0800194
Tao Bao97555da2016-12-15 10:15:06 -0800195# libimgdiff (host static library)
196# ===============================
197include $(CLEAR_VARS)
198LOCAL_SRC_FILES := \
199 $(libimgdiff_src_files)
200LOCAL_MODULE := libimgdiff
201LOCAL_CFLAGS := \
202 $(libimgdiff_cflags)
203LOCAL_STATIC_LIBRARIES := \
204 $(libimgdiff_static_libraries)
205LOCAL_C_INCLUDES := \
206 $(LOCAL_PATH)/include
207LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
208include $(BUILD_HOST_STATIC_LIBRARY)
209
Tao Baod80a9982016-03-03 11:43:47 -0800210# imgdiff (host static executable)
211# ===============================
Doug Zongker512536a2010-02-17 16:11:44 -0800212include $(CLEAR_VARS)
Tao Bao97555da2016-12-15 10:15:06 -0800213LOCAL_SRC_FILES := imgdiff_main.cpp
Doug Zongker512536a2010-02-17 16:11:44 -0800214LOCAL_MODULE := imgdiff
Tianjie Xu7aa88742016-09-28 11:42:17 -0700215LOCAL_CFLAGS := -Werror
Tao Bao97555da2016-12-15 10:15:06 -0800216LOCAL_STATIC_LIBRARIES := \
217 libimgdiff \
218 $(libimgdiff_static_libraries) \
Sen Jiang930edb62017-01-18 17:26:42 -0800219 libbz
Doug Zongker512536a2010-02-17 16:11:44 -0800220include $(BUILD_HOST_EXECUTABLE)