blob: cb0b367461cb8a04bd8f5781baa99b415f4c9988 [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",
56 "libotafault",
57 "libotautil",
58 "libz",
59 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080060
61 target: {
62 darwin: {
63 enabled: false,
64 },
65 },
Tao Bao582b6782017-10-05 09:06:21 -070066}
67
68cc_library_static {
69 name: "libapplypatch_modes",
70
71 defaults: [
72 "applypatch_defaults",
73 ],
74
75 srcs: [
76 "applypatch_modes.cpp",
77 ],
78
79 static_libs: [
80 "libapplypatch",
81 "libbase",
82 "libcrypto",
83 "libedify",
84 "libotautil",
85 ],
86}
87
88cc_binary {
89 name: "applypatch",
90
91 defaults: [
92 "applypatch_defaults",
93 ],
94
95 srcs: [
96 "applypatch_main.cpp",
97 ],
98
99 static_libs: [
100 "libapplypatch_modes",
101 "libapplypatch",
102 "libedify",
103 "libotafault",
104 "libotautil",
105 "libbspatch",
106 ],
107
108 shared_libs: [
109 "libbase",
Tianjie Xu3d843862017-11-03 15:52:22 -0700110 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700111 "libbz",
112 "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}