blob: 75dec371bc2ecc58b6e7958d7cffc470a1e3e807 [file] [log] [blame]
Dan Willemsen4c939742016-12-06 15:44:57 -08001cc_defaults {
2 name: "installd_defaults",
3
4 cflags: [
5 "-Wall",
6 "-Werror",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -06007 "-Wextra",
Andreas Gampefa2dadd2018-02-28 19:52:47 -08008
9 "-Wunreachable-code",
10 "-Wunreachable-code-break",
11 "-Wunreachable-code-return",
Dan Willemsen4c939742016-12-06 15:44:57 -080012 ],
13 srcs: [
Jeff Sharkey88ddd942017-01-17 18:05:54 -070014 "CacheItem.cpp",
15 "CacheTracker.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070016 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060017 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070018 "dexopt.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080019 "globals.cpp",
20 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010021 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080022 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080023 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080024 ],
Andreas Gampefa2dadd2018-02-28 19:52:47 -080025 header_libs: [
26 "dex2oat_headers",
27 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080028 shared_libs: [
29 "libbase",
30 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010031 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080032 "libcutils",
33 "liblog",
34 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070035 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080036 "libselinux",
37 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000038 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080039 ],
40
Risand57852c2018-11-02 04:51:14 +090041 product_variables: {
42 arc: {
43 exclude_srcs: [
44 "QuotaUtils.cpp",
45 ],
46 static_libs: [
47 "libarcdiskquota",
48 "arc_services_aidl",
49 ],
50 cflags: [
51 "-DUSE_ARC",
52 ],
53 },
54 },
55
Dan Willemsen4c939742016-12-06 15:44:57 -080056 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060057
58 tidy: true,
59 tidy_checks: [
60 "-*",
61 "clang-analyzer-security*",
62 "cert-*",
63 "-cert-err58-cpp",
64 ],
65 tidy_flags: [
66 "-warnings-as-errors=clang-analyzer-security*,cert-*"
67 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080068}
69
70//
71// Static library used in testing and executable
72//
73
74cc_library_static {
75 name: "libinstalld",
76 defaults: ["installd_defaults"],
77
78 export_include_dirs: ["."],
79 aidl: {
80 export_aidl_headers: true,
81 },
Risand57852c2018-11-02 04:51:14 +090082
83 product_variables: {
84 arc: {
85 exclude_srcs: [
86 "QuotaUtils.cpp",
87 ],
88 static_libs: [
89 "libarcdiskquota",
90 "arc_services_aidl",
91 ],
92 cflags: [
93 "-DUSE_ARC",
94 ],
95 },
96 },
97}
98
99cc_library_headers {
100 name: "libinstalld_headers",
101 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800102}
103
104//
105// Executable
106//
107
108cc_binary {
109 name: "installd",
110 defaults: ["installd_defaults"],
111 srcs: ["installd.cpp"],
112
113 static_libs: ["libdiskusage"],
114
115 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900116
117 product_variables: {
118 arc: {
119 exclude_srcs: [
120 "QuotaUtils.cpp",
121 ],
122 static_libs: [
123 "libarcdiskquota",
124 "arc_services_aidl",
125 ],
126 cflags: [
127 "-DUSE_ARC",
128 ],
129 },
130 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100131
132 // Needs to be wherever installd is as it's execed by
133 // installd.
134 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800135}
136
Dan Willemsen2a001e82016-08-05 14:06:41 -0700137// OTA chroot tool
138
139cc_binary {
140 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200141 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700142 cflags: [
143 "-Wall",
144 "-Werror",
145 ],
146 clang: true,
147
Roland Levillain94b41802019-01-18 11:56:50 +0000148 srcs: [
149 "otapreopt_chroot.cpp",
150 "otapreopt_utils.cpp",
151 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700152 shared_libs: [
153 "libbase",
154 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100155 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000156 ],
157 static_libs: [
Roland Levillainc19c6042018-12-18 12:15:12 +0000158 "libapexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700159 ],
160}
Dan Willemsen4c939742016-12-06 15:44:57 -0800161
Colin Crossdd2dae92017-11-14 13:05:37 -0800162filegroup {
163 name: "installd_aidl",
164 srcs: [
165 "binder/android/os/IInstalld.aidl",
166 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700167 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800168}
169
Calin Juravledff47292018-02-01 14:44:56 +0000170//
171// Static library for otapreopt used in testing
172//
173cc_library_static {
174 name: "libotapreoptparameters",
175 cflags: [
176 "-Wall",
177 "-Werror"
178 ],
Calin Juravledff47292018-02-01 14:44:56 +0000179
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700180 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000181
182 export_include_dirs: ["."],
183
184 shared_libs: [
185 "libbase",
186 "libcutils",
187 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700188 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000189 "libutils",
190 ],
191}
192
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700193//
194// OTA Executable
195//
196
197cc_binary {
198 name: "otapreopt",
199 cflags: [
200 "-Wall",
201 "-Werror"
202 ],
203
204 srcs: [
205 "dexopt.cpp",
206 "globals.cpp",
207 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000208 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700209 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100210 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800211 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700212 ],
213
214 header_libs: ["dex2oat_headers"],
215
216 static_libs: [
217 "libartimagevalues",
218 "libdiskusage",
219 "libotapreoptparameters",
220 ],
221
222 shared_libs: [
223 "libbase",
224 "libcrypto",
225 "libcutils",
226 "liblog",
227 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700228 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700229 "libselinux",
230 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000231 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700232 ],
233}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800234
235// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800236sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800237 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800238 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800239 init_rc: ["otapreopt.rc"],
240}
241
242// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800243sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800244 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800245 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800246 // Let this depend on otapreopt, the chroot tool and the slot script,
247 // so we just have to mention one in a configuration.
248 required: [
249 "otapreopt",
250 "otapreopt_chroot",
251 "otapreopt_slot",
252 ],
253}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100254
255// Script to migrate legacy obb data.
256sh_binary {
257 name: "migrate_legacy_obb_data.sh",
258 src: "migrate_legacy_obb_data.sh"
259}