xref: /aosp_15_r20/bootable/deprecated-ota/updater/Android.bp (revision acea8879c968027b49a027136800575dd9783ddf)
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
15cc_defaults {
16    name: "libupdater_static_libs",
17
18    static_libs: [
19        "libapplypatch",
20        "libbootloader_message",
21        "libbspatch",
22        "libedify",
23        "libotautil",
24        "libext4_utils",
25        "libdm",
26        "libfec",
27        "libfec_rs",
28        "libavb",
29        "libverity_tree",
30        "liblog",
31        "liblp",
32        "libselinux",
33        "libsparse",
34        "libsquashfs_utils",
35        "libbrotli",
36        "libbz",
37        "libziparchive",
38        "libz_stable",
39        "libbase",
40        "libcrypto_utils",
41        "libcutils",
42        "libutils",
43    ],
44    header_libs: [
45        "libgtest_prod_headers",
46    ],
47}
48
49cc_defaults {
50    name: "libupdater_defaults",
51
52    defaults: [
53        "recovery_defaults",
54        "libupdater_static_libs",
55    ],
56
57    shared_libs: [
58        "libcrypto",
59    ],
60}
61
62cc_defaults {
63    name: "libupdater_device_defaults",
64
65    static_libs: [
66        "libfs_mgr",
67        "libtune2fs",
68
69        "libext2_com_err",
70        "libext2_blkid",
71        "libext2_quota",
72        "libext2_uuid",
73        "libext2_e2p",
74        "libext2fs",
75    ],
76}
77
78cc_library_static {
79    name: "libupdater_core",
80
81    host_supported: true,
82
83    defaults: [
84        "recovery_defaults",
85        "libupdater_defaults",
86    ],
87
88    srcs: [
89        "blockimg.cpp",
90        "commands.cpp",
91        "install.cpp",
92        "mounts.cpp",
93        "updater.cpp",
94    ],
95
96    target: {
97        darwin: {
98            enabled: false,
99        },
100    },
101
102    export_include_dirs: [
103        "include",
104    ],
105}
106
107cc_library_static {
108    name: "libupdater_device",
109
110    defaults: [
111        "recovery_defaults",
112        "libupdater_defaults",
113        "libupdater_device_defaults",
114    ],
115
116    srcs: [
117        "dynamic_partitions.cpp",
118        "updater_runtime.cpp",
119        "updater_runtime_dynamic_partitions.cpp",
120    ],
121
122    static_libs: [
123        "libupdater_core",
124    ],
125
126    include_dirs: [
127        "external/e2fsprogs/misc",
128    ],
129
130    export_include_dirs: [
131        "include",
132    ],
133}
134
135cc_library_host_static {
136    name: "libupdater_host",
137
138    defaults: [
139        "recovery_defaults",
140        "libupdater_defaults",
141    ],
142
143    srcs: [
144        "build_info.cpp",
145        "dynamic_partitions.cpp",
146        "simulator_runtime.cpp",
147        "target_files.cpp",
148    ],
149
150    static_libs: [
151        "libupdater_core",
152        "libfstab",
153    ],
154
155    target: {
156        darwin: {
157            enabled: false,
158        },
159    },
160
161    export_include_dirs: [
162        "include",
163    ],
164}
165
166cc_binary_host {
167    name: "update_host_simulator",
168    defaults: ["libupdater_static_libs"],
169
170    srcs: ["update_simulator_main.cpp"],
171
172    cflags: [
173        "-Wall",
174        "-Werror",
175    ],
176
177    static_libs: [
178        "libupdater_host",
179        "libupdater_core",
180        "libcrypto_static",
181        "libfstab",
182    ],
183
184    target: {
185        darwin: {
186            enabled: false,
187        },
188    },
189}
190