blob: afab76c20f029b7c6ee920525eb4f3242a2ab687 [file] [log] [blame]
Tao Baod2f2ad62018-03-23 23:24:25 -07001// Copyright (C) 2018 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
15cc_defaults {
16 name: "recovery_defaults",
17
18 cflags: [
Tao Bao818f9382018-08-06 15:52:24 -070019 "-D_FILE_OFFSET_BITS=64",
20
21 // Must be the same as RECOVERY_API_VERSION.
22 "-DRECOVERY_API_VERSION=3",
23
Tao Baod2f2ad62018-03-23 23:24:25 -070024 "-Wall",
25 "-Werror",
26 ],
Tao Bao43bfa6e2018-08-28 10:09:13 -070027
28 cpp_std: "c++17",
Tao Baod2f2ad62018-03-23 23:24:25 -070029}
30
Tao Bao5fc72a12018-08-07 14:38:51 -070031cc_library {
32 name: "librecovery_ui",
33 recovery_available: true,
34
35 defaults: [
36 "recovery_defaults",
37 ],
38
39 srcs: [
40 "device.cpp",
41 "screen_ui.cpp",
42 "ui.cpp",
43 "vr_ui.cpp",
44 "wear_ui.cpp"
45 ],
46
47 static_libs: [
48 "libminui",
49 "libotautil",
50 ],
51
52 shared_libs: [
53 "libbase",
54 "libpng",
55 "libz",
56 ],
57}
58
Tao Baod2f2ad62018-03-23 23:24:25 -070059// Generic device that uses ScreenRecoveryUI.
60cc_library_static {
61 name: "librecovery_ui_default",
Tao Bao818f9382018-08-06 15:52:24 -070062 recovery_available: true,
Tao Baod2f2ad62018-03-23 23:24:25 -070063
64 defaults: [
65 "recovery_defaults",
66 ],
67
68 srcs: [
69 "default_device.cpp",
70 ],
71}
72
73// The default wear device that uses WearRecoveryUI.
74cc_library_static {
75 name: "librecovery_ui_wear",
Tao Bao818f9382018-08-06 15:52:24 -070076 recovery_available: true,
Tao Baod2f2ad62018-03-23 23:24:25 -070077
78 defaults: [
79 "recovery_defaults",
80 ],
81
82 srcs: [
83 "wear_device.cpp",
84 ],
85}
86
87// The default VR device that uses VrRecoveryUI.
88cc_library_static {
89 name: "librecovery_ui_vr",
Tao Bao818f9382018-08-06 15:52:24 -070090 recovery_available: true,
Tao Baod2f2ad62018-03-23 23:24:25 -070091
92 defaults: [
93 "recovery_defaults",
94 ],
95
96 srcs: [
97 "vr_device.cpp",
98 ],
99}
100
Hridya Valsaraju20c81b32018-07-27 22:09:12 -0700101cc_library_static {
102 name: "librecovery_fastboot",
103 recovery_available: true,
104 defaults: [
105 "recovery_defaults",
106 ],
107
108 srcs: [
109 "fastboot/fastboot.cpp",
110 ],
111
112 shared_libs: [
113 "libbase",
114 "libbootloader_message",
115 "libcutils",
116 "liblog",
117 ],
118
119 static_libs: [
120 "librecovery_ui_default",
121 ],
122}
123
Tao Bao5fc72a12018-08-07 14:38:51 -0700124cc_defaults {
125 name: "librecovery_defaults",
126
127 defaults: [
128 "recovery_defaults",
129 ],
130
131 shared_libs: [
Yifan Hong056538c2018-07-11 17:04:12 -0700132 "android.hardware.health@2.0",
Tao Bao5fc72a12018-08-07 14:38:51 -0700133 "libbase",
134 "libbootloader_message",
135 "libcrypto",
Tao Bao5fc72a12018-08-07 14:38:51 -0700136 "libcutils",
137 "libext4_utils",
138 "libfs_mgr",
139 "libfusesideload",
140 "libhidl-gen-utils",
Yifan Hong056538c2018-07-11 17:04:12 -0700141 "libhidlbase",
142 "libhidltransport",
Tao Bao5fc72a12018-08-07 14:38:51 -0700143 "liblog",
144 "libpng",
145 "libselinux",
Tao Bao5fc72a12018-08-07 14:38:51 -0700146 "libtinyxml2",
147 "libutils",
148 "libz",
149 "libziparchive",
150 ],
151
152 static_libs: [
Hridya Valsaraju20c81b32018-07-27 22:09:12 -0700153 "librecovery_fastboot",
Tao Bao5fc72a12018-08-07 14:38:51 -0700154 "libminui",
155 "libverifier",
156 "libotautil",
Yifan Hong056538c2018-07-11 17:04:12 -0700157
158 // external dependencies
159 "libhealthhalutils",
Tao Bao5fc72a12018-08-07 14:38:51 -0700160 "libvintf_recovery",
161 "libvintf",
Tao Bao5fc72a12018-08-07 14:38:51 -0700162 ],
163}
164
165cc_library_static {
166 name: "librecovery",
167 recovery_available: true,
168
169 defaults: [
170 "librecovery_defaults",
171 ],
172
173 srcs: [
174 "adb_install.cpp",
175 "fsck_unshare_blocks.cpp",
176 "fuse_sdcard_provider.cpp",
177 "install.cpp",
178 "recovery.cpp",
179 "roots.cpp",
180 ],
181
182 include_dirs: [
183 "system/vold",
184 ],
185}
186
Tao Baod2f2ad62018-03-23 23:24:25 -0700187cc_library_static {
Tao Baod2f2ad62018-03-23 23:24:25 -0700188 name: "libverifier",
Tao Bao818f9382018-08-06 15:52:24 -0700189 recovery_available: true,
Tao Baod2f2ad62018-03-23 23:24:25 -0700190
191 defaults: [
192 "recovery_defaults",
193 ],
194
195 srcs: [
196 "asn1_decoder.cpp",
197 "verifier.cpp",
198 ],
199
Tao Bao818f9382018-08-06 15:52:24 -0700200 shared_libs: [
Tao Baod2f2ad62018-03-23 23:24:25 -0700201 "libbase",
202 "libcrypto",
203 "libcrypto_utils",
Tao Bao818f9382018-08-06 15:52:24 -0700204 ],
205
206 static_libs: [
Tao Baod2f2ad62018-03-23 23:24:25 -0700207 "libotautil",
208 ],
209}
210
Tao Bao5fc72a12018-08-07 14:38:51 -0700211cc_binary {
212 name: "recovery",
213 recovery: true,
214
215 defaults: [
216 "librecovery_defaults",
217 ],
218
219 srcs: [
220 "logging.cpp",
221 "recovery_main.cpp",
222 ],
223
224 shared_libs: [
Tao Bao7d2a63a2018-08-13 11:15:29 -0700225 "libminadbd_services",
Tao Bao5fc72a12018-08-07 14:38:51 -0700226 "librecovery_ui",
227 ],
228
229 static_libs: [
230 "librecovery",
231 "librecovery_ui_default",
232 ],
233
234 required: [
235 "e2fsdroid.recovery",
236 "librecovery_ui_ext",
Tao Bao7c074d92018-08-21 12:31:51 -0700237 "mke2fs.conf.recovery",
Tao Bao5fc72a12018-08-07 14:38:51 -0700238 "mke2fs.recovery",
239 "recovery_deps",
240 ],
241}
242
Tao Baod2f2ad62018-03-23 23:24:25 -0700243// The dynamic executable that runs after /data mounts.
244cc_binary {
245 name: "recovery-persist",
246
247 defaults: [
248 "recovery_defaults",
249 ],
250
251 srcs: [
Jerry Zhang152933a2018-05-02 16:56:00 -0700252 "logging.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700253 "recovery-persist.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700254 ],
255
256 shared_libs: [
257 "libbase",
258 "liblog",
259 ],
260
Jerry Zhang152933a2018-05-02 16:56:00 -0700261 static_libs: [
262 "libotautil",
263 ],
264
Tao Baod2f2ad62018-03-23 23:24:25 -0700265 init_rc: [
266 "recovery-persist.rc",
267 ],
268}
269
270// The dynamic executable that runs at init.
271cc_binary {
272 name: "recovery-refresh",
273
274 defaults: [
275 "recovery_defaults",
276 ],
277
278 srcs: [
Jerry Zhang152933a2018-05-02 16:56:00 -0700279 "logging.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700280 "recovery-refresh.cpp",
Tao Baod2f2ad62018-03-23 23:24:25 -0700281 ],
282
283 shared_libs: [
284 "libbase",
285 "liblog",
286 ],
287
Jerry Zhang152933a2018-05-02 16:56:00 -0700288 static_libs: [
289 "libotautil",
290 ],
291
Tao Baod2f2ad62018-03-23 23:24:25 -0700292 init_rc: [
293 "recovery-refresh.rc",
294 ],
295}
Tao Baoef5e38f2018-07-24 15:34:39 -0700296
297filegroup {
298 name: "res-testdata",
299
300 srcs: [
301 "res-*/images/*_text.png",
302 ],
303}