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", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 66 | "libfs_mgr", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 67 | "liblog", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 68 | "libziparchive", |
| 69 | ], |
| 70 | |
| 71 | static_libs: [ |
Tao Bao | 2f8afba | 2019-04-08 11:26:11 -0700 | [diff] [blame^] | 72 | "libinstall", |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 73 | "librecovery_fastboot", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 74 | "libminui", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 75 | "libotautil", |
Yifan Hong | 056538c | 2018-07-11 17:04:12 -0700 | [diff] [blame] | 76 | |
| 77 | // external dependencies |
| 78 | "libhealthhalutils", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 79 | "libfstab", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 80 | ], |
| 81 | } |
| 82 | |
| 83 | cc_library_static { |
| 84 | name: "librecovery", |
| 85 | recovery_available: true, |
| 86 | |
| 87 | defaults: [ |
| 88 | "librecovery_defaults", |
| 89 | ], |
| 90 | |
| 91 | srcs: [ |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 92 | "fsck_unshare_blocks.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 93 | "recovery.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 94 | ], |
| 95 | |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 96 | shared_libs: [ |
| 97 | "librecovery_ui", |
| 98 | ], |
xunchang | 37304f3 | 2019-03-12 12:40:14 -0700 | [diff] [blame] | 99 | } |
| 100 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 101 | cc_binary { |
| 102 | name: "recovery", |
| 103 | recovery: true, |
| 104 | |
| 105 | defaults: [ |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 106 | "libinstall_defaults", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 107 | "librecovery_defaults", |
| 108 | ], |
| 109 | |
| 110 | srcs: [ |
| 111 | "logging.cpp", |
| 112 | "recovery_main.cpp", |
| 113 | ], |
| 114 | |
| 115 | shared_libs: [ |
Tao Bao | 7d2a63a | 2018-08-13 11:15:29 -0700 | [diff] [blame] | 116 | "libminadbd_services", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 117 | "librecovery_ui", |
| 118 | ], |
| 119 | |
| 120 | static_libs: [ |
| 121 | "librecovery", |
| 122 | "librecovery_ui_default", |
| 123 | ], |
| 124 | |
| 125 | required: [ |
| 126 | "e2fsdroid.recovery", |
| 127 | "librecovery_ui_ext", |
Tao Bao | 7c074d9 | 2018-08-21 12:31:51 -0700 | [diff] [blame] | 128 | "mke2fs.conf.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 129 | "mke2fs.recovery", |
| 130 | "recovery_deps", |
| 131 | ], |
| 132 | } |
| 133 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 134 | // The dynamic executable that runs after /data mounts. |
| 135 | cc_binary { |
| 136 | name: "recovery-persist", |
| 137 | |
| 138 | defaults: [ |
| 139 | "recovery_defaults", |
| 140 | ], |
| 141 | |
| 142 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 143 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 144 | "recovery-persist.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 145 | ], |
| 146 | |
| 147 | shared_libs: [ |
| 148 | "libbase", |
| 149 | "liblog", |
Tianjie Xu | 2b1a464 | 2018-09-06 11:58:55 -0700 | [diff] [blame] | 150 | "libmetricslogger", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 151 | ], |
| 152 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 153 | static_libs: [ |
| 154 | "libotautil", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 155 | "libfstab", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 156 | ], |
| 157 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 158 | init_rc: [ |
| 159 | "recovery-persist.rc", |
| 160 | ], |
| 161 | } |
| 162 | |
| 163 | // The dynamic executable that runs at init. |
| 164 | cc_binary { |
| 165 | name: "recovery-refresh", |
| 166 | |
| 167 | defaults: [ |
| 168 | "recovery_defaults", |
| 169 | ], |
| 170 | |
| 171 | srcs: [ |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 172 | "logging.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 173 | "recovery-refresh.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 174 | ], |
| 175 | |
| 176 | shared_libs: [ |
| 177 | "libbase", |
| 178 | "liblog", |
| 179 | ], |
| 180 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 181 | static_libs: [ |
| 182 | "libotautil", |
Tom Cherry | 72a114a | 2019-01-30 15:59:53 -0800 | [diff] [blame] | 183 | "libfstab", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 184 | ], |
| 185 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 186 | init_rc: [ |
| 187 | "recovery-refresh.rc", |
| 188 | ], |
| 189 | } |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 190 | |
| 191 | filegroup { |
| 192 | name: "res-testdata", |
| 193 | |
| 194 | srcs: [ |
| 195 | "res-*/images/*_text.png", |
| 196 | ], |
| 197 | } |