Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | cc_defaults { |
| 16 | name: "recovery_defaults", |
| 17 | |
| 18 | cflags: [ |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 19 | "-D_FILE_OFFSET_BITS=64", |
| 20 | |
| 21 | // Must be the same as RECOVERY_API_VERSION. |
| 22 | "-DRECOVERY_API_VERSION=3", |
| 23 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 24 | "-Wall", |
| 25 | "-Werror", |
| 26 | ], |
| 27 | } |
| 28 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 29 | cc_library { |
| 30 | name: "librecovery_ui", |
| 31 | recovery_available: true, |
| 32 | |
| 33 | defaults: [ |
| 34 | "recovery_defaults", |
| 35 | ], |
| 36 | |
| 37 | srcs: [ |
| 38 | "device.cpp", |
| 39 | "screen_ui.cpp", |
| 40 | "ui.cpp", |
| 41 | "vr_ui.cpp", |
| 42 | "wear_ui.cpp" |
| 43 | ], |
| 44 | |
| 45 | static_libs: [ |
| 46 | "libminui", |
| 47 | "libotautil", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 48 | "libfstab", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 49 | ], |
| 50 | |
| 51 | shared_libs: [ |
| 52 | "libbase", |
| 53 | "libpng", |
| 54 | "libz", |
| 55 | ], |
| 56 | } |
| 57 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 58 | // Generic device that uses ScreenRecoveryUI. |
| 59 | cc_library_static { |
| 60 | name: "librecovery_ui_default", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 61 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 62 | |
| 63 | defaults: [ |
| 64 | "recovery_defaults", |
| 65 | ], |
| 66 | |
| 67 | srcs: [ |
| 68 | "default_device.cpp", |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | // The default wear device that uses WearRecoveryUI. |
| 73 | cc_library_static { |
| 74 | name: "librecovery_ui_wear", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 75 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 76 | |
| 77 | defaults: [ |
| 78 | "recovery_defaults", |
| 79 | ], |
| 80 | |
| 81 | srcs: [ |
| 82 | "wear_device.cpp", |
| 83 | ], |
| 84 | } |
| 85 | |
| 86 | // The default VR device that uses VrRecoveryUI. |
| 87 | cc_library_static { |
| 88 | name: "librecovery_ui_vr", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 89 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 90 | |
| 91 | defaults: [ |
| 92 | "recovery_defaults", |
| 93 | ], |
| 94 | |
| 95 | srcs: [ |
| 96 | "vr_device.cpp", |
| 97 | ], |
| 98 | } |
| 99 | |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 100 | cc_library_static { |
| 101 | name: "librecovery_fastboot", |
| 102 | recovery_available: true, |
| 103 | defaults: [ |
| 104 | "recovery_defaults", |
| 105 | ], |
| 106 | |
| 107 | srcs: [ |
| 108 | "fastboot/fastboot.cpp", |
| 109 | ], |
| 110 | |
| 111 | shared_libs: [ |
| 112 | "libbase", |
| 113 | "libbootloader_message", |
| 114 | "libcutils", |
| 115 | "liblog", |
| 116 | ], |
| 117 | |
| 118 | static_libs: [ |
| 119 | "librecovery_ui_default", |
| 120 | ], |
| 121 | } |
| 122 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 123 | cc_defaults { |
| 124 | name: "librecovery_defaults", |
| 125 | |
| 126 | defaults: [ |
| 127 | "recovery_defaults", |
| 128 | ], |
| 129 | |
| 130 | shared_libs: [ |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 131 | "android.hardware.health@2.0", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 132 | "libbase", |
| 133 | "libbootloader_message", |
| 134 | "libcrypto", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 135 | "libcutils", |
| 136 | "libext4_utils", |
| 137 | "libfs_mgr", |
| 138 | "libfusesideload", |
| 139 | "libhidl-gen-utils", |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 140 | "libhidlbase", |
| 141 | "libhidltransport", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 142 | "liblog", |
| 143 | "libpng", |
| 144 | "libselinux", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 145 | "libtinyxml2", |
| 146 | "libutils", |
| 147 | "libz", |
| 148 | "libziparchive", |
| 149 | ], |
| 150 | |
| 151 | static_libs: [ |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 152 | "librecovery_fastboot", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 153 | "libminui", |
xunchang | 37304f3 | 2019-03-12 12:40:14 -0700 | [diff] [blame] | 154 | "libpackage", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 155 | "libverifier", |
| 156 | "libotautil", |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 157 | |
| 158 | // external dependencies |
| 159 | "libhealthhalutils", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 160 | "libvintf_recovery", |
| 161 | "libvintf", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 162 | "libfstab", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 163 | ], |
| 164 | } |
| 165 | |
| 166 | cc_library_static { |
| 167 | name: "librecovery", |
| 168 | recovery_available: true, |
| 169 | |
| 170 | defaults: [ |
| 171 | "librecovery_defaults", |
| 172 | ], |
| 173 | |
| 174 | srcs: [ |
| 175 | "adb_install.cpp", |
| 176 | "fsck_unshare_blocks.cpp", |
xunchang | ea2912f | 2019-03-17 16:45:12 -0700 | [diff] [blame] | 177 | "fuse_sdcard_install.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 178 | "install.cpp", |
| 179 | "recovery.cpp", |
| 180 | "roots.cpp", |
| 181 | ], |
| 182 | |
| 183 | include_dirs: [ |
| 184 | "system/vold", |
| 185 | ], |
| 186 | } |
| 187 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 188 | cc_library_static { |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 189 | name: "libverifier", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 190 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 191 | |
| 192 | defaults: [ |
| 193 | "recovery_defaults", |
| 194 | ], |
| 195 | |
| 196 | srcs: [ |
| 197 | "asn1_decoder.cpp", |
| 198 | "verifier.cpp", |
| 199 | ], |
| 200 | |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 201 | shared_libs: [ |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 202 | "libbase", |
| 203 | "libcrypto", |
| 204 | "libcrypto_utils", |
Tianjie Xu | 0dd9685 | 2018-10-15 11:44:14 -0700 | [diff] [blame] | 205 | "libziparchive", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 206 | ], |
| 207 | |
| 208 | static_libs: [ |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 209 | "libotautil", |
| 210 | ], |
| 211 | } |
| 212 | |
xunchang | 37304f3 | 2019-03-12 12:40:14 -0700 | [diff] [blame] | 213 | cc_library_static { |
| 214 | name: "libpackage", |
| 215 | recovery_available: true, |
| 216 | |
| 217 | defaults: [ |
| 218 | "recovery_defaults", |
| 219 | ], |
| 220 | |
| 221 | srcs: [ |
| 222 | "package.cpp", |
| 223 | ], |
| 224 | |
| 225 | shared_libs: [ |
| 226 | "libbase", |
| 227 | "libcrypto", |
| 228 | "libziparchive", |
| 229 | ], |
| 230 | |
| 231 | static_libs: [ |
| 232 | "libotautil", |
| 233 | ], |
| 234 | } |
| 235 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 236 | cc_binary { |
| 237 | name: "recovery", |
| 238 | recovery: true, |
| 239 | |
| 240 | defaults: [ |
| 241 | "librecovery_defaults", |
| 242 | ], |
| 243 | |
| 244 | srcs: [ |
| 245 | "logging.cpp", |
| 246 | "recovery_main.cpp", |
| 247 | ], |
| 248 | |
| 249 | shared_libs: [ |
Tao Bao | 7d2a63a | 2018-08-13 11:15:29 -0700 | [diff] [blame] | 250 | "libminadbd_services", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 251 | "librecovery_ui", |
| 252 | ], |
| 253 | |
| 254 | static_libs: [ |
| 255 | "librecovery", |
| 256 | "librecovery_ui_default", |
| 257 | ], |
| 258 | |
| 259 | required: [ |
| 260 | "e2fsdroid.recovery", |
| 261 | "librecovery_ui_ext", |
Tao Bao | 7c074d9 | 2018-08-21 12:31:51 -0700 | [diff] [blame] | 262 | "mke2fs.conf.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 263 | "mke2fs.recovery", |
| 264 | "recovery_deps", |
| 265 | ], |
| 266 | } |
| 267 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 268 | // The dynamic executable that runs after /data mounts. |
| 269 | cc_binary { |
| 270 | name: "recovery-persist", |
| 271 | |
| 272 | defaults: [ |
| 273 | "recovery_defaults", |
| 274 | ], |
| 275 | |
| 276 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 277 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 278 | "recovery-persist.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 279 | ], |
| 280 | |
| 281 | shared_libs: [ |
| 282 | "libbase", |
| 283 | "liblog", |
Tianjie Xu | 2b1a464 | 2018-09-06 11:58:55 -0700 | [diff] [blame] | 284 | "libmetricslogger", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 285 | ], |
| 286 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 287 | static_libs: [ |
| 288 | "libotautil", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 289 | "libfstab", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 290 | ], |
| 291 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 292 | init_rc: [ |
| 293 | "recovery-persist.rc", |
| 294 | ], |
| 295 | } |
| 296 | |
| 297 | // The dynamic executable that runs at init. |
| 298 | cc_binary { |
| 299 | name: "recovery-refresh", |
| 300 | |
| 301 | defaults: [ |
| 302 | "recovery_defaults", |
| 303 | ], |
| 304 | |
| 305 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 306 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 307 | "recovery-refresh.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 308 | ], |
| 309 | |
| 310 | shared_libs: [ |
| 311 | "libbase", |
| 312 | "liblog", |
| 313 | ], |
| 314 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 315 | static_libs: [ |
| 316 | "libotautil", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 317 | "libfstab", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 318 | ], |
| 319 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 320 | init_rc: [ |
| 321 | "recovery-refresh.rc", |
| 322 | ], |
| 323 | } |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 324 | |
| 325 | filegroup { |
| 326 | name: "res-testdata", |
| 327 | |
| 328 | srcs: [ |
| 329 | "res-*/images/*_text.png", |
| 330 | ], |
| 331 | } |