blob: 3ecfc9503c4e226ad15036866dd2dcc7b47b18fd [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",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000037 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080038 ],
39
Risand57852c2018-11-02 04:51:14 +090040 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 Willemsen4c939742016-12-06 15:44:57 -080055 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060056
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 Willemsen4c939742016-12-06 15:44:57 -080067}
68
69//
70// Static library used in testing and executable
71//
72
73cc_library_static {
74 name: "libinstalld",
75 defaults: ["installd_defaults"],
76
77 export_include_dirs: ["."],
78 aidl: {
79 export_aidl_headers: true,
80 },
Risand57852c2018-11-02 04:51:14 +090081
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
98cc_library_headers {
99 name: "libinstalld_headers",
100 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800101}
102
103//
104// Executable
105//
106
107cc_binary {
108 name: "installd",
109 defaults: ["installd_defaults"],
110 srcs: ["installd.cpp"],
111
112 static_libs: ["libdiskusage"],
113
114 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900115
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 Willemsen4c939742016-12-06 15:44:57 -0800130}
131
Dan Willemsen2a001e82016-08-05 14:06:41 -0700132// OTA chroot tool
133
134cc_binary {
135 name: "otapreopt_chroot",
136 cflags: [
137 "-Wall",
138 "-Werror",
139 ],
140 clang: true,
141
Roland Levillain94b41802019-01-18 11:56:50 +0000142 srcs: [
143 "otapreopt_chroot.cpp",
144 "otapreopt_utils.cpp",
145 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700146 shared_libs: [
147 "libbase",
Martijn Coenen13eba262019-03-13 12:59:57 +0100148 "libbinder",
Jooyung Han6b1c58a2019-06-14 15:31:02 +0900149 "libcrypto",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700150 "liblog",
Roland Levillainc19c6042018-12-18 12:15:12 +0000151 "libprotobuf-cpp-full",
152 "libselinux",
Martijn Coenen13eba262019-03-13 12:59:57 +0100153 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000154 "libziparchive",
155 ],
156 static_libs: [
157 "libapex",
158 "libapexd",
159 "lib_apex_manifest_proto",
160 "libavb",
161 "libdm",
Jooyung Han6b1c58a2019-06-14 15:31:02 +0900162 "libverity_tree",
Martijn Coenen13eba262019-03-13 12:59:57 +0100163 "libvold_binder",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700164 ],
165}
Dan Willemsen4c939742016-12-06 15:44:57 -0800166
Colin Crossdd2dae92017-11-14 13:05:37 -0800167filegroup {
168 name: "installd_aidl",
169 srcs: [
170 "binder/android/os/IInstalld.aidl",
171 ],
Dan Willemsen9ba6e652018-09-14 21:27:01 -0700172 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800173}
174
Calin Juravledff47292018-02-01 14:44:56 +0000175//
176// Static library for otapreopt used in testing
177//
178cc_library_static {
179 name: "libotapreoptparameters",
180 cflags: [
181 "-Wall",
182 "-Werror"
183 ],
Calin Juravledff47292018-02-01 14:44:56 +0000184
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700185 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000186
187 export_include_dirs: ["."],
188
189 shared_libs: [
190 "libbase",
191 "libcutils",
192 "liblog",
Suren Baghdasaryan1cc5de62019-01-25 05:29:23 +0000193 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000194 "libutils",
195 ],
196}
197
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700198//
199// OTA Executable
200//
201
202cc_binary {
203 name: "otapreopt",
204 cflags: [
205 "-Wall",
206 "-Werror"
207 ],
208
209 srcs: [
210 "dexopt.cpp",
211 "globals.cpp",
212 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000213 "otapreopt_utils.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700214 "utils.cpp",
Eric Holk2af5e6a2019-01-09 18:17:27 -0800215 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700216 ],
217
218 header_libs: ["dex2oat_headers"],
219
220 static_libs: [
221 "libartimagevalues",
222 "libdiskusage",
223 "libotapreoptparameters",
224 ],
225
226 shared_libs: [
227 "libbase",
228 "libcrypto",
229 "libcutils",
230 "liblog",
231 "liblogwrap",
Suren Baghdasaryan1cc5de62019-01-25 05:29:23 +0000232 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700233 "libselinux",
234 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000235 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700236 ],
237}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800238
239// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800240sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800241 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800242 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800243 init_rc: ["otapreopt.rc"],
244}
245
246// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800247sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800248 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800249 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800250 // Let this depend on otapreopt, the chroot tool and the slot script,
251 // so we just have to mention one in a configuration.
252 required: [
253 "otapreopt",
254 "otapreopt_chroot",
255 "otapreopt_slot",
256 ],
257}