blob: 620ca6cc984ce8f394c83e7409ea6818c8854a56 [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",
103 "libbspatch",
104 ],
105
106 shared_libs: [
107 "libbase",
Tianjie Xu3d843862017-11-03 15:52:22 -0700108 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700109 "libbz",
110 "libcrypto",
111 "liblog",
112 "libz",
113 "libziparchive",
114 ],
115}
116
117cc_library_static {
118 name: "libimgdiff",
119
120 host_supported: true,
121
122 defaults: [
123 "applypatch_defaults",
124 ],
125
126 srcs: [
127 "imgdiff.cpp",
128 ],
129
130 export_include_dirs: [
131 "include",
132 ],
133
134 static_libs: [
135 "libbase",
136 "libbsdiff",
137 "libdivsufsort",
138 "libdivsufsort64",
139 "liblog",
140 "libotautil",
141 "libutils",
142 "libz",
143 "libziparchive",
144 ],
145}
146
147cc_binary_host {
148 name: "imgdiff",
149
150 srcs: [
151 "imgdiff_main.cpp",
152 ],
153
154 defaults: [
155 "applypatch_defaults",
156 ],
157
158 static_libs: [
159 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700160 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700161 "libbsdiff",
162 "libdivsufsort",
163 "libdivsufsort64",
164 "libziparchive",
165 "libbase",
166 "libutils",
167 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700168 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700169 "libbz",
170 "libz",
171 ],
172}
173
174cc_library_static {
175 name: "libimgpatch",
176
177 // The host module is for recovery_host_test (Linux only).
178 host_supported: true,
179
180 defaults: [
181 "applypatch_defaults",
182 ],
183
184 srcs: [
185 "bspatch.cpp",
186 "imgpatch.cpp",
187 ],
188
189 static_libs: [
190 "libbase",
191 "libbspatch",
192 "libbz",
193 "libcrypto",
194 "libedify",
195 "libotautil",
196 "libz",
197 ],
198
199 target: {
200 darwin: {
201 enabled: false,
202 },
203 },
204}