blob: 9b72a7e1aaaf47bfd895528427e79085599d751e [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,
34
Tao Bao582b6782017-10-05 09:06:21 -070035 defaults: [
36 "applypatch_defaults",
37 ],
38
39 srcs: [
40 "applypatch.cpp",
41 "bspatch.cpp",
42 "freecache.cpp",
43 "imgpatch.cpp",
44 ],
45
46 export_include_dirs: [
47 "include",
48 ],
49
50 static_libs: [
51 "libbase",
52 "libbspatch",
53 "libbz",
54 "libcrypto",
55 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -070056 "libotautil",
57 "libz",
58 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080059
60 target: {
61 darwin: {
62 enabled: false,
63 },
64 },
Tao Bao582b6782017-10-05 09:06:21 -070065}
66
67cc_library_static {
68 name: "libapplypatch_modes",
69
70 defaults: [
71 "applypatch_defaults",
72 ],
73
74 srcs: [
75 "applypatch_modes.cpp",
76 ],
77
78 static_libs: [
79 "libapplypatch",
80 "libbase",
81 "libcrypto",
82 "libedify",
83 "libotautil",
84 ],
85}
86
87cc_binary {
88 name: "applypatch",
89
90 defaults: [
91 "applypatch_defaults",
92 ],
93
94 srcs: [
95 "applypatch_main.cpp",
96 ],
97
98 static_libs: [
99 "libapplypatch_modes",
100 "libapplypatch",
101 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -0700102 "libotautil",
Tao Baoe420a372019-09-23 08:58:44 -0700103
104 // External dependencies.
Tao Bao582b6782017-10-05 09:06:21 -0700105 "libbspatch",
Tao Baoe420a372019-09-23 08:58:44 -0700106 "libbrotli",
107 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -0700108 ],
109
110 shared_libs: [
111 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700112 "libcrypto",
113 "liblog",
114 "libz",
115 "libziparchive",
116 ],
117}
118
119cc_library_static {
120 name: "libimgdiff",
121
122 host_supported: true,
123
124 defaults: [
125 "applypatch_defaults",
126 ],
127
128 srcs: [
129 "imgdiff.cpp",
130 ],
131
132 export_include_dirs: [
133 "include",
134 ],
135
136 static_libs: [
137 "libbase",
138 "libbsdiff",
139 "libdivsufsort",
140 "libdivsufsort64",
141 "liblog",
142 "libotautil",
143 "libutils",
144 "libz",
145 "libziparchive",
146 ],
147}
148
149cc_binary_host {
150 name: "imgdiff",
151
152 srcs: [
153 "imgdiff_main.cpp",
154 ],
155
156 defaults: [
157 "applypatch_defaults",
158 ],
159
160 static_libs: [
161 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700162 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700163 "libbsdiff",
164 "libdivsufsort",
165 "libdivsufsort64",
166 "libziparchive",
167 "libbase",
168 "libutils",
169 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700170 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700171 "libbz",
172 "libz",
173 ],
174}
175
176cc_library_static {
177 name: "libimgpatch",
178
179 // The host module is for recovery_host_test (Linux only).
180 host_supported: true,
181
182 defaults: [
183 "applypatch_defaults",
184 ],
185
186 srcs: [
187 "bspatch.cpp",
188 "imgpatch.cpp",
189 ],
190
191 static_libs: [
192 "libbase",
193 "libbspatch",
194 "libbz",
195 "libcrypto",
196 "libedify",
197 "libotautil",
198 "libz",
199 ],
200
201 target: {
202 darwin: {
203 enabled: false,
204 },
205 },
206}