Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "installd_defaults", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 7 | "-Wextra", |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 8 | |
| 9 | "-Wunreachable-code", |
| 10 | "-Wunreachable-code-break", |
| 11 | "-Wunreachable-code-return", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 12 | ], |
| 13 | srcs: [ |
Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 14 | "CacheItem.cpp", |
| 15 | "CacheTracker.cpp", |
Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 16 | "InstalldNativeService.cpp", |
Risan | 5f30826 | 2018-10-26 12:06:58 -0600 | [diff] [blame] | 17 | "QuotaUtils.cpp", |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 18 | "dexopt.cpp", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 19 | "globals.cpp", |
| 20 | "utils.cpp", |
Eric Holk | 2af5e6a | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 21 | "view_compiler.cpp", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 22 | ":installd_aidl", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 23 | ], |
Andreas Gampe | fa2dadd | 2018-02-28 19:52:47 -0800 | [diff] [blame] | 24 | header_libs: [ |
| 25 | "dex2oat_headers", |
| 26 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 27 | shared_libs: [ |
| 28 | "libbase", |
| 29 | "libbinder", |
Alan Stokes | a25d90c | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 30 | "libcrypto", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 31 | "libcutils", |
| 32 | "liblog", |
| 33 | "liblogwrap", |
Suren Baghdasaryan | 1cc5de6 | 2019-01-25 05:29:23 +0000 | [diff] [blame] | 34 | "libprocessgroup", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 35 | "libselinux", |
| 36 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 37 | "server_configurable_flags", |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 38 | ], |
| 39 | |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 40 | product_variables: { |
| 41 | arc: { |
| 42 | exclude_srcs: [ |
| 43 | "QuotaUtils.cpp", |
| 44 | ], |
| 45 | static_libs: [ |
| 46 | "libarcdiskquota", |
| 47 | "arc_services_aidl", |
| 48 | ], |
| 49 | cflags: [ |
| 50 | "-DUSE_ARC", |
| 51 | ], |
| 52 | }, |
| 53 | }, |
| 54 | |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 55 | clang: true, |
Jeff Sharkey | c1149c9 | 2017-09-21 14:51:09 -0600 | [diff] [blame] | 56 | |
| 57 | tidy: true, |
| 58 | tidy_checks: [ |
| 59 | "-*", |
| 60 | "clang-analyzer-security*", |
| 61 | "cert-*", |
| 62 | "-cert-err58-cpp", |
| 63 | ], |
| 64 | tidy_flags: [ |
| 65 | "-warnings-as-errors=clang-analyzer-security*,cert-*" |
| 66 | ], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | // |
| 70 | // Static library used in testing and executable |
| 71 | // |
| 72 | |
| 73 | cc_library_static { |
| 74 | name: "libinstalld", |
| 75 | defaults: ["installd_defaults"], |
| 76 | |
| 77 | export_include_dirs: ["."], |
| 78 | aidl: { |
| 79 | export_aidl_headers: true, |
| 80 | }, |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 81 | |
| 82 | product_variables: { |
| 83 | arc: { |
| 84 | exclude_srcs: [ |
| 85 | "QuotaUtils.cpp", |
| 86 | ], |
| 87 | static_libs: [ |
| 88 | "libarcdiskquota", |
| 89 | "arc_services_aidl", |
| 90 | ], |
| 91 | cflags: [ |
| 92 | "-DUSE_ARC", |
| 93 | ], |
| 94 | }, |
| 95 | }, |
| 96 | } |
| 97 | |
| 98 | cc_library_headers { |
| 99 | name: "libinstalld_headers", |
| 100 | export_include_dirs: ["."], |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | // |
| 104 | // Executable |
| 105 | // |
| 106 | |
| 107 | cc_binary { |
| 108 | name: "installd", |
| 109 | defaults: ["installd_defaults"], |
| 110 | srcs: ["installd.cpp"], |
| 111 | |
| 112 | static_libs: ["libdiskusage"], |
| 113 | |
| 114 | init_rc: ["installd.rc"], |
Risan | d57852c | 2018-11-02 04:51:14 +0900 | [diff] [blame] | 115 | |
| 116 | product_variables: { |
| 117 | arc: { |
| 118 | exclude_srcs: [ |
| 119 | "QuotaUtils.cpp", |
| 120 | ], |
| 121 | static_libs: [ |
| 122 | "libarcdiskquota", |
| 123 | "arc_services_aidl", |
| 124 | ], |
| 125 | cflags: [ |
| 126 | "-DUSE_ARC", |
| 127 | ], |
| 128 | }, |
| 129 | }, |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 130 | } |
| 131 | |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 132 | // OTA chroot tool |
| 133 | |
| 134 | cc_binary { |
| 135 | name: "otapreopt_chroot", |
Martijn Coenen | 8af07d9 | 2019-07-03 14:56:39 +0200 | [diff] [blame^] | 136 | defaults: ["libapexd-deps"], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 137 | cflags: [ |
| 138 | "-Wall", |
| 139 | "-Werror", |
| 140 | ], |
| 141 | clang: true, |
| 142 | |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 143 | srcs: [ |
| 144 | "otapreopt_chroot.cpp", |
| 145 | "otapreopt_utils.cpp", |
| 146 | ], |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 147 | shared_libs: [ |
| 148 | "libbase", |
| 149 | "liblog", |
Martijn Coenen | 13eba26 | 2019-03-13 12:59:57 +0100 | [diff] [blame] | 150 | "libutils", |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 151 | ], |
| 152 | static_libs: [ |
Roland Levillain | c19c604 | 2018-12-18 12:15:12 +0000 | [diff] [blame] | 153 | "libapexd", |
Dan Willemsen | 2a001e8 | 2016-08-05 14:06:41 -0700 | [diff] [blame] | 154 | ], |
| 155 | } |
Dan Willemsen | 4c93974 | 2016-12-06 15:44:57 -0800 | [diff] [blame] | 156 | |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 157 | filegroup { |
| 158 | name: "installd_aidl", |
| 159 | srcs: [ |
| 160 | "binder/android/os/IInstalld.aidl", |
| 161 | ], |
Dan Willemsen | 9ba6e65 | 2018-09-14 21:27:01 -0700 | [diff] [blame] | 162 | path: "binder", |
Colin Cross | dd2dae9 | 2017-11-14 13:05:37 -0800 | [diff] [blame] | 163 | } |
| 164 | |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 165 | // |
| 166 | // Static library for otapreopt used in testing |
| 167 | // |
| 168 | cc_library_static { |
| 169 | name: "libotapreoptparameters", |
| 170 | cflags: [ |
| 171 | "-Wall", |
| 172 | "-Werror" |
| 173 | ], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 174 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 175 | srcs: ["otapreopt_parameters.cpp"], |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 176 | |
| 177 | export_include_dirs: ["."], |
| 178 | |
| 179 | shared_libs: [ |
| 180 | "libbase", |
| 181 | "libcutils", |
| 182 | "liblog", |
Suren Baghdasaryan | 1cc5de6 | 2019-01-25 05:29:23 +0000 | [diff] [blame] | 183 | "libprocessgroup", |
Calin Juravle | dff4729 | 2018-02-01 14:44:56 +0000 | [diff] [blame] | 184 | "libutils", |
| 185 | ], |
| 186 | } |
| 187 | |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 188 | // |
| 189 | // OTA Executable |
| 190 | // |
| 191 | |
| 192 | cc_binary { |
| 193 | name: "otapreopt", |
| 194 | cflags: [ |
| 195 | "-Wall", |
| 196 | "-Werror" |
| 197 | ], |
| 198 | |
| 199 | srcs: [ |
| 200 | "dexopt.cpp", |
| 201 | "globals.cpp", |
| 202 | "otapreopt.cpp", |
Roland Levillain | 94b4180 | 2019-01-18 11:56:50 +0000 | [diff] [blame] | 203 | "otapreopt_utils.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 204 | "utils.cpp", |
Eric Holk | 2af5e6a | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 205 | "view_compiler.cpp", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 206 | ], |
| 207 | |
| 208 | header_libs: ["dex2oat_headers"], |
| 209 | |
| 210 | static_libs: [ |
| 211 | "libartimagevalues", |
| 212 | "libdiskusage", |
| 213 | "libotapreoptparameters", |
| 214 | ], |
| 215 | |
| 216 | shared_libs: [ |
| 217 | "libbase", |
| 218 | "libcrypto", |
| 219 | "libcutils", |
| 220 | "liblog", |
| 221 | "liblogwrap", |
Suren Baghdasaryan | 1cc5de6 | 2019-01-25 05:29:23 +0000 | [diff] [blame] | 222 | "libprocessgroup", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 223 | "libselinux", |
| 224 | "libutils", |
Nicolas Geoffray | aaad21e | 2019-02-25 13:31:10 +0000 | [diff] [blame] | 225 | "server_configurable_flags", |
Andreas Gampe | ce9fe7f | 2018-09-18 10:25:58 -0700 | [diff] [blame] | 226 | ], |
| 227 | } |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 228 | |
| 229 | // OTA slot script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 230 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 231 | name: "otapreopt_slot", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 232 | src: "otapreopt_slot.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 233 | init_rc: ["otapreopt.rc"], |
| 234 | } |
| 235 | |
| 236 | // OTA postinstall script |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 237 | sh_binary { |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 238 | name: "otapreopt_script", |
Sasha Smundak | 1fa4b8d | 2019-02-04 11:20:58 -0800 | [diff] [blame] | 239 | src: "otapreopt_script.sh", |
Sasha Smundak | 6a6bdad | 2019-01-24 23:20:47 -0800 | [diff] [blame] | 240 | // Let this depend on otapreopt, the chroot tool and the slot script, |
| 241 | // so we just have to mention one in a configuration. |
| 242 | required: [ |
| 243 | "otapreopt", |
| 244 | "otapreopt_chroot", |
| 245 | "otapreopt_slot", |
| 246 | ], |
| 247 | } |