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