blob: 80d8041b1db6fd2e24d01f7e5ae68ce2ad1fcf8e [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
15cc_defaults {
16 name: "applypatch_defaults",
17
18 cflags: [
19 "-D_FILE_OFFSET_BITS=64",
20 "-DZLIB_CONST",
21 "-Wall",
22 "-Werror",
23 ],
24
25 local_include_dirs: [
26 "include",
27 ],
28}
29
30cc_library_static {
31 name: "libapplypatch",
32
Tianjie Xue40c80d2018-02-03 17:20:56 -080033 host_supported: true,
Bill Peckham341644d2019-09-17 17:11:50 -070034 vendor_available: true,
Tianjie Xue40c80d2018-02-03 17:20:56 -080035
Tao Bao582b6782017-10-05 09:06:21 -070036 defaults: [
37 "applypatch_defaults",
38 ],
39
40 srcs: [
41 "applypatch.cpp",
42 "bspatch.cpp",
43 "freecache.cpp",
44 "imgpatch.cpp",
45 ],
46
47 export_include_dirs: [
48 "include",
49 ],
50
51 static_libs: [
52 "libbase",
53 "libbspatch",
54 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -070055 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -070056 "libotautil",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -050057 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -070058 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080059
Pete Bentley189d4242019-09-12 19:53:46 +010060 shared_libs: [
61 "libcrypto",
62 ],
63
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080064 target: {
65 darwin: {
66 enabled: false,
67 },
68 },
Tao Bao582b6782017-10-05 09:06:21 -070069}
70
71cc_library_static {
72 name: "libapplypatch_modes",
Bill Peckham341644d2019-09-17 17:11:50 -070073 vendor_available: true,
Kelvin Zhang2f2749f2021-01-12 14:42:56 -050074 host_supported: true,
Tao Bao582b6782017-10-05 09:06:21 -070075
76 defaults: [
77 "applypatch_defaults",
78 ],
79
80 srcs: [
81 "applypatch_modes.cpp",
82 ],
83
84 static_libs: [
85 "libapplypatch",
86 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -070087 "libedify",
88 "libotautil",
89 ],
Pete Bentley189d4242019-09-12 19:53:46 +010090
91 shared_libs: [
92 "libcrypto",
93 ],
Tao Bao582b6782017-10-05 09:06:21 -070094}
95
96cc_binary {
97 name: "applypatch",
Bill Peckham341644d2019-09-17 17:11:50 -070098 vendor: true,
Kelvin Zhang2f2749f2021-01-12 14:42:56 -050099 host_supported: true,
Tao Bao582b6782017-10-05 09:06:21 -0700100
101 defaults: [
102 "applypatch_defaults",
103 ],
104
105 srcs: [
106 "applypatch_main.cpp",
107 ],
108
109 static_libs: [
110 "libapplypatch_modes",
111 "libapplypatch",
112 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -0700113 "libotautil",
Tao Bao71c35b92019-09-23 08:58:44 -0700114
115 // External dependencies.
Tao Bao582b6782017-10-05 09:06:21 -0700116 "libbspatch",
Tao Bao71c35b92019-09-23 08:58:44 -0700117 "libbrotli",
118 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -0700119 ],
120
121 shared_libs: [
122 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700123 "libcrypto",
124 "liblog",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500125 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700126 "libziparchive",
127 ],
Bill Peckham341644d2019-09-17 17:11:50 -0700128
129 init_rc: [
130 "vendor_flash_recovery.rc",
131 ],
Tao Bao582b6782017-10-05 09:06:21 -0700132}
133
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500134cc_library_static {
Tao Bao582b6782017-10-05 09:06:21 -0700135 name: "libimgdiff",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500136 host_supported: true,
Tao Bao582b6782017-10-05 09:06:21 -0700137 defaults: [
138 "applypatch_defaults",
139 ],
140
141 srcs: [
142 "imgdiff.cpp",
143 ],
144
145 export_include_dirs: [
146 "include",
147 ],
148
149 static_libs: [
150 "libbase",
151 "libbsdiff",
152 "libdivsufsort",
153 "libdivsufsort64",
154 "liblog",
155 "libotautil",
156 "libutils",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500157 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700158 "libziparchive",
159 ],
160}
161
162cc_binary_host {
163 name: "imgdiff",
Tao Bao582b6782017-10-05 09:06:21 -0700164 srcs: [
165 "imgdiff_main.cpp",
166 ],
167
168 defaults: [
169 "applypatch_defaults",
170 ],
171
172 static_libs: [
173 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700174 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700175 "libbsdiff",
176 "libdivsufsort",
177 "libdivsufsort64",
178 "libziparchive",
179 "libbase",
180 "libutils",
181 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700182 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700183 "libbz",
Kelvin Zhang2f2749f2021-01-12 14:42:56 -0500184 "libz_stable",
Tao Bao582b6782017-10-05 09:06:21 -0700185 ],
186}