blob: d3efa152b40685e6f13c42bc07d5c1ab19852ca7 [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 ],
60}
61
62cc_library_static {
63 name: "libapplypatch_modes",
64
65 defaults: [
66 "applypatch_defaults",
67 ],
68
69 srcs: [
70 "applypatch_modes.cpp",
71 ],
72
73 static_libs: [
74 "libapplypatch",
75 "libbase",
76 "libcrypto",
77 "libedify",
78 "libotautil",
79 ],
80}
81
82cc_binary {
83 name: "applypatch",
84
85 defaults: [
86 "applypatch_defaults",
87 ],
88
89 srcs: [
90 "applypatch_main.cpp",
91 ],
92
93 static_libs: [
94 "libapplypatch_modes",
95 "libapplypatch",
96 "libedify",
97 "libotafault",
98 "libotautil",
99 "libbspatch",
100 ],
101
102 shared_libs: [
103 "libbase",
Tianjie Xu3d843862017-11-03 15:52:22 -0700104 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700105 "libbz",
106 "libcrypto",
107 "liblog",
108 "libz",
109 "libziparchive",
110 ],
111}
112
113cc_library_static {
114 name: "libimgdiff",
115
116 host_supported: true,
117
118 defaults: [
119 "applypatch_defaults",
120 ],
121
122 srcs: [
123 "imgdiff.cpp",
124 ],
125
126 export_include_dirs: [
127 "include",
128 ],
129
130 static_libs: [
131 "libbase",
132 "libbsdiff",
133 "libdivsufsort",
134 "libdivsufsort64",
135 "liblog",
136 "libotautil",
137 "libutils",
138 "libz",
139 "libziparchive",
140 ],
141}
142
143cc_binary_host {
144 name: "imgdiff",
145
146 srcs: [
147 "imgdiff_main.cpp",
148 ],
149
150 defaults: [
151 "applypatch_defaults",
152 ],
153
154 static_libs: [
155 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700156 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700157 "libbsdiff",
158 "libdivsufsort",
159 "libdivsufsort64",
160 "libziparchive",
161 "libbase",
162 "libutils",
163 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700164 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700165 "libbz",
166 "libz",
167 ],
168}
169
170cc_library_static {
171 name: "libimgpatch",
172
173 // The host module is for recovery_host_test (Linux only).
174 host_supported: true,
175
176 defaults: [
177 "applypatch_defaults",
178 ],
179
180 srcs: [
181 "bspatch.cpp",
182 "imgpatch.cpp",
183 ],
184
185 static_libs: [
186 "libbase",
187 "libbspatch",
188 "libbz",
189 "libcrypto",
190 "libedify",
191 "libotautil",
192 "libz",
193 ],
194
195 target: {
196 darwin: {
197 enabled: false,
198 },
199 },
200}