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 | ], |
Tao Bao | 43bfa6e | 2018-08-28 10:09:13 -0700 | [diff] [blame] | 27 | |
| 28 | cpp_std: "c++17", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 29 | } |
| 30 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 31 | cc_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 Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 59 | // Generic device that uses ScreenRecoveryUI. |
| 60 | cc_library_static { |
| 61 | name: "librecovery_ui_default", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 62 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 63 | |
| 64 | defaults: [ |
| 65 | "recovery_defaults", |
| 66 | ], |
| 67 | |
| 68 | srcs: [ |
| 69 | "default_device.cpp", |
| 70 | ], |
| 71 | } |
| 72 | |
| 73 | // The default wear device that uses WearRecoveryUI. |
| 74 | cc_library_static { |
| 75 | name: "librecovery_ui_wear", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 76 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 77 | |
| 78 | defaults: [ |
| 79 | "recovery_defaults", |
| 80 | ], |
| 81 | |
| 82 | srcs: [ |
| 83 | "wear_device.cpp", |
| 84 | ], |
| 85 | } |
| 86 | |
| 87 | // The default VR device that uses VrRecoveryUI. |
| 88 | cc_library_static { |
| 89 | name: "librecovery_ui_vr", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 90 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 91 | |
| 92 | defaults: [ |
| 93 | "recovery_defaults", |
| 94 | ], |
| 95 | |
| 96 | srcs: [ |
| 97 | "vr_device.cpp", |
| 98 | ], |
| 99 | } |
| 100 | |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 101 | cc_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 Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 124 | cc_defaults { |
| 125 | name: "librecovery_defaults", |
| 126 | |
| 127 | defaults: [ |
| 128 | "recovery_defaults", |
| 129 | ], |
| 130 | |
| 131 | shared_libs: [ |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 132 | "android.hardware.health@2.0", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 133 | "libbase", |
| 134 | "libbootloader_message", |
| 135 | "libcrypto", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 136 | "libcutils", |
| 137 | "libext4_utils", |
| 138 | "libfs_mgr", |
| 139 | "libfusesideload", |
| 140 | "libhidl-gen-utils", |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 141 | "libhidlbase", |
| 142 | "libhidltransport", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 143 | "liblog", |
| 144 | "libpng", |
| 145 | "libselinux", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 146 | "libtinyxml2", |
| 147 | "libutils", |
| 148 | "libz", |
| 149 | "libziparchive", |
| 150 | ], |
| 151 | |
| 152 | static_libs: [ |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 153 | "librecovery_fastboot", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 154 | "libminui", |
| 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", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 162 | ], |
| 163 | } |
| 164 | |
| 165 | cc_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 Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 187 | cc_library_static { |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 188 | name: "libverifier", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 189 | recovery_available: true, |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 190 | |
| 191 | defaults: [ |
| 192 | "recovery_defaults", |
| 193 | ], |
| 194 | |
| 195 | srcs: [ |
| 196 | "asn1_decoder.cpp", |
| 197 | "verifier.cpp", |
| 198 | ], |
| 199 | |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 200 | shared_libs: [ |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 201 | "libbase", |
| 202 | "libcrypto", |
| 203 | "libcrypto_utils", |
Tianjie Xu | 0dd9685 | 2018-10-15 11:44:14 -0700 | [diff] [blame] | 204 | "libziparchive", |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 205 | ], |
| 206 | |
| 207 | static_libs: [ |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 208 | "libotautil", |
| 209 | ], |
| 210 | } |
| 211 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 212 | cc_binary { |
| 213 | name: "recovery", |
| 214 | recovery: true, |
| 215 | |
| 216 | defaults: [ |
| 217 | "librecovery_defaults", |
| 218 | ], |
| 219 | |
| 220 | srcs: [ |
| 221 | "logging.cpp", |
| 222 | "recovery_main.cpp", |
| 223 | ], |
| 224 | |
| 225 | shared_libs: [ |
Tao Bao | 7d2a63a | 2018-08-13 11:15:29 -0700 | [diff] [blame] | 226 | "libminadbd_services", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 227 | "librecovery_ui", |
| 228 | ], |
| 229 | |
| 230 | static_libs: [ |
| 231 | "librecovery", |
| 232 | "librecovery_ui_default", |
| 233 | ], |
| 234 | |
| 235 | required: [ |
| 236 | "e2fsdroid.recovery", |
| 237 | "librecovery_ui_ext", |
Tao Bao | 7c074d9 | 2018-08-21 12:31:51 -0700 | [diff] [blame] | 238 | "mke2fs.conf.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 239 | "mke2fs.recovery", |
| 240 | "recovery_deps", |
| 241 | ], |
| 242 | } |
| 243 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 244 | // The dynamic executable that runs after /data mounts. |
| 245 | cc_binary { |
| 246 | name: "recovery-persist", |
| 247 | |
| 248 | defaults: [ |
| 249 | "recovery_defaults", |
| 250 | ], |
| 251 | |
| 252 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 253 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 254 | "recovery-persist.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 255 | ], |
| 256 | |
| 257 | shared_libs: [ |
| 258 | "libbase", |
| 259 | "liblog", |
Tianjie Xu | 2b1a464 | 2018-09-06 11:58:55 -0700 | [diff] [blame] | 260 | "libmetricslogger", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 261 | ], |
| 262 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 263 | static_libs: [ |
| 264 | "libotautil", |
| 265 | ], |
| 266 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 267 | init_rc: [ |
| 268 | "recovery-persist.rc", |
| 269 | ], |
| 270 | } |
| 271 | |
| 272 | // The dynamic executable that runs at init. |
| 273 | cc_binary { |
| 274 | name: "recovery-refresh", |
| 275 | |
| 276 | defaults: [ |
| 277 | "recovery_defaults", |
| 278 | ], |
| 279 | |
| 280 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 281 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 282 | "recovery-refresh.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 283 | ], |
| 284 | |
| 285 | shared_libs: [ |
| 286 | "libbase", |
| 287 | "liblog", |
| 288 | ], |
| 289 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 290 | static_libs: [ |
| 291 | "libotautil", |
| 292 | ], |
| 293 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 294 | init_rc: [ |
| 295 | "recovery-refresh.rc", |
| 296 | ], |
| 297 | } |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 298 | |
| 299 | filegroup { |
| 300 | name: "res-testdata", |
| 301 | |
| 302 | srcs: [ |
| 303 | "res-*/images/*_text.png", |
| 304 | ], |
| 305 | } |