blob: 9d3a234d760ebbacd9fb21171884266ddbe1a80a [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",
Eric Holk2af5e6a2019-01-09 18:17:27 -080021 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080022 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080023 ],
Andreas Gampefa2dadd2018-02-28 19:52:47 -080024 header_libs: [
25 "dex2oat_headers",
26 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080027 shared_libs: [
28 "libbase",
29 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010030 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080031 "libcutils",
32 "liblog",
33 "liblogwrap",
Suren Baghdasaryan1cc5de62019-01-25 05:29:23 +000034 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080035 "libselinux",
36 "libutils",
37 ],
38
Risand57852c2018-11-02 04:51:14 +090039 product_variables: {
40 arc: {
41 exclude_srcs: [
42 "QuotaUtils.cpp",
43 ],
44 static_libs: [
45 "libarcdiskquota",
46 "arc_services_aidl",
47 ],
48 cflags: [
49 "-DUSE_ARC",
50 ],
51 },
52 },
53
Dan Willemsen4c939742016-12-06 15:44:57 -080054 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060055
56 tidy: true,
57 tidy_checks: [
58 "-*",
59 "clang-analyzer-security*",
60 "cert-*",
61 "-cert-err58-cpp",
62 ],
63 tidy_flags: [
64 "-warnings-as-errors=clang-analyzer-security*,cert-*"
65 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080066}
67
68//
69// Static library used in testing and executable
70//
71
72cc_library_static {
73 name: "libinstalld",
74 defaults: ["installd_defaults"],
75
76 export_include_dirs: ["."],
77 aidl: {
78 export_aidl_headers: true,
79 },
Risand57852c2018-11-02 04:51:14 +090080
81 product_variables: {
82 arc: {
83 exclude_srcs: [
84 "QuotaUtils.cpp",
85 ],
86 static_libs: [
87 "libarcdiskquota",
88 "arc_services_aidl",
89 ],
90 cflags: [
91 "-DUSE_ARC",
92 ],
93 },
94 },
95}
96
97cc_library_headers {
98 name: "libinstalld_headers",
99 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800100}
101
102//
103// Executable
104//
105
106cc_binary {
107 name: "installd",
108 defaults: ["installd_defaults"],
109 srcs: ["installd.cpp"],
110
111 static_libs: ["libdiskusage"],
112
113 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900114
115 product_variables: {
116 arc: {
117 exclude_srcs: [
118 "QuotaUtils.cpp",
119 ],
120 static_libs: [
121 "libarcdiskquota",
122 "arc_services_aidl",
123 ],
124 cflags: [
125 "-DUSE_ARC",
126 ],
127 },
128 },
Dan Willemsen4c939742016-12-06 15:44:57 -0800129}
130
Dan Willemsen2a001e82016-08-05 14:06:41 -0700131// OTA chroot tool
132
133cc_binary {
134 name: "otapreopt_chroot",
135 cflags: [
136 "-Wall",
137 "-Werror",
138 ],
139 clang: true,
140
Roland Levillain94b41802019-01-18 11:56:50 +0000141 srcs: [
142 "otapreopt_chroot.cpp",
143 "otapreopt_utils.cpp",
144 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700145 shared_libs: [
146 "libbase",
147 "liblog",
Roland Levillainc19c6042018-12-18 12:15:12 +0000148 "libprotobuf-cpp-full",
149 "libselinux",
150 "libziparchive",
151 ],
152 static_libs: [
153 "libapex",
154 "libapexd",
155 "lib_apex_manifest_proto",
156 "libavb",
157 "libdm",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700158 ],
159}
Dan Willemsen4c939742016-12-06 15:44:57 -0800160
Colin Crossdd2dae92017-11-14 13:05:37 -0800161filegroup {
162 name: "installd_aidl",
163 srcs: [
164 "binder/android/os/IInstalld.aidl",
165 ],
166}
167
Calin Juravledff47292018-02-01 14:44:56 +0000168//
169// Static library for otapreopt used in testing
170//
171cc_library_static {
172 name: "libotapreoptparameters",
173 cflags: [
174 "-Wall",
175 "-Werror"
176 ],
Calin Juravledff47292018-02-01 14:44:56 +0000177
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700178 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000179
180 export_include_dirs: ["."],
181
182 shared_libs: [
183 "libbase",
184 "libcutils",
185 "liblog",
Suren Baghdasaryan1cc5de62019-01-25 05:29:23 +0000186 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000187 "libutils",
188 ],
189}
190
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700191//
192// OTA Executable
193//
194
195cc_binary {
196 name: "otapreopt",
197 cflags: [
198 "-Wall",
199 "-Werror"
200 ],
201
202 srcs: [
203 "dexopt.cpp",
204 "globals.cpp",
205 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000206 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700207 "utils.cpp",
Eric Holk2af5e6a2019-01-09 18:17:27 -0800208 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700209 ],
210
211 header_libs: ["dex2oat_headers"],
212
213 static_libs: [
214 "libartimagevalues",
215 "libdiskusage",
216 "libotapreoptparameters",
217 ],
218
219 shared_libs: [
220 "libbase",
221 "libcrypto",
222 "libcutils",
223 "liblog",
224 "liblogwrap",
Suren Baghdasaryan1cc5de62019-01-25 05:29:23 +0000225 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700226 "libselinux",
227 "libutils",
228 ],
229}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800230
231// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800232sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800233 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800234 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800235 init_rc: ["otapreopt.rc"],
236}
237
238// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800239sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800240 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800241 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800242 // Let this depend on otapreopt, the chroot tool and the slot script,
243 // so we just have to mention one in a configuration.
244 required: [
245 "otapreopt",
246 "otapreopt_chroot",
247 "otapreopt_slot",
248 ],
249}