blob: 0d6d23b90cd4c90867bade90ec6c471e27fd5ee0 [file] [log] [blame]
Tao Bao582b6782017-10-05 09:06:21 -07001// Copyright (C) 2017 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
Bob Badour29be3f62021-02-12 18:00:57 -080015package {
16 default_applicable_licenses: ["bootable_recovery_applypatch_license"],
17}
18
19// Added automatically by a large-scale-change
20// See: http://go/android-license-faq
21license {
22 name: "bootable_recovery_applypatch_license",
23 visibility: [":__subpackages__"],
24 license_kinds: [
25 "SPDX-license-identifier-Apache-2.0",
26 ],
27 license_text: [
28 "NOTICE",
29 ],
30}
31
Tao Bao582b6782017-10-05 09:06:21 -070032cc_defaults {
33 name: "applypatch_defaults",
34
35 cflags: [
36 "-D_FILE_OFFSET_BITS=64",
37 "-DZLIB_CONST",
38 "-Wall",
39 "-Werror",
40 ],
41
42 local_include_dirs: [
43 "include",
44 ],
45}
46
47cc_library_static {
48 name: "libapplypatch",
49
Tianjie Xue40c80d2018-02-03 17:20:56 -080050 host_supported: true,
Bill Peckham341644d2019-09-17 17:11:50 -070051 vendor_available: true,
Tianjie Xue40c80d2018-02-03 17:20:56 -080052
Tao Bao582b6782017-10-05 09:06:21 -070053 defaults: [
54 "applypatch_defaults",
55 ],
56
57 srcs: [
58 "applypatch.cpp",
59 "bspatch.cpp",
60 "freecache.cpp",
61 "imgpatch.cpp",
62 ],
63
64 export_include_dirs: [
65 "include",
66 ],
67
68 static_libs: [
69 "libbase",
70 "libbspatch",
71 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -070072 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -070073 "libotautil",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -050074 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -070075 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080076
Pete Bentley189d4242019-09-12 19:53:46 +010077 shared_libs: [
78 "libcrypto",
79 ],
80
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080081 target: {
82 darwin: {
83 enabled: false,
84 },
85 },
Tao Bao582b6782017-10-05 09:06:21 -070086}
87
88cc_library_static {
89 name: "libapplypatch_modes",
Bill Peckham341644d2019-09-17 17:11:50 -070090 vendor_available: true,
Tao Bao582b6782017-10-05 09:06:21 -070091
92 defaults: [
93 "applypatch_defaults",
94 ],
95
96 srcs: [
97 "applypatch_modes.cpp",
98 ],
99
100 static_libs: [
101 "libapplypatch",
102 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700103 "libedify",
104 "libotautil",
105 ],
Pete Bentley189d4242019-09-12 19:53:46 +0100106
107 shared_libs: [
108 "libcrypto",
109 ],
Tao Bao582b6782017-10-05 09:06:21 -0700110}
111
112cc_binary {
113 name: "applypatch",
Bill Peckham341644d2019-09-17 17:11:50 -0700114 vendor: true,
Tao Bao582b6782017-10-05 09:06:21 -0700115
116 defaults: [
117 "applypatch_defaults",
118 ],
119
120 srcs: [
121 "applypatch_main.cpp",
122 ],
123
124 static_libs: [
125 "libapplypatch_modes",
126 "libapplypatch",
127 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -0700128 "libotautil",
Tao Bao71c35b92019-09-23 08:58:44 -0700129
130 // External dependencies.
Tao Bao582b6782017-10-05 09:06:21 -0700131 "libbspatch",
Tao Bao71c35b92019-09-23 08:58:44 -0700132 "libbrotli",
133 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -0700134 ],
135
136 shared_libs: [
137 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700138 "libcrypto",
139 "liblog",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500140 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700141 "libziparchive",
142 ],
Bill Peckham341644d2019-09-17 17:11:50 -0700143
144 init_rc: [
145 "vendor_flash_recovery.rc",
146 ],
Tao Bao582b6782017-10-05 09:06:21 -0700147}
148
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500149cc_library_static {
Tao Bao582b6782017-10-05 09:06:21 -0700150 name: "libimgdiff",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500151 host_supported: true,
Tao Bao582b6782017-10-05 09:06:21 -0700152 defaults: [
153 "applypatch_defaults",
154 ],
155
156 srcs: [
157 "imgdiff.cpp",
158 ],
159
160 export_include_dirs: [
161 "include",
162 ],
163
164 static_libs: [
165 "libbase",
166 "libbsdiff",
167 "libdivsufsort",
168 "libdivsufsort64",
169 "liblog",
170 "libotautil",
171 "libutils",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500172 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700173 "libziparchive",
174 ],
175}
176
177cc_binary_host {
178 name: "imgdiff",
Tao Bao582b6782017-10-05 09:06:21 -0700179 srcs: [
180 "imgdiff_main.cpp",
181 ],
182
183 defaults: [
184 "applypatch_defaults",
185 ],
186
187 static_libs: [
188 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700189 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700190 "libbsdiff",
191 "libdivsufsort",
192 "libdivsufsort64",
193 "libziparchive",
194 "libbase",
195 "libutils",
196 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700197 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700198 "libbz",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500199 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700200 ],
201}