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