blob: 922f67abf229b2c1ffd1bced729cfbb78d641cc4 [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
33 defaults: [
34 "applypatch_defaults",
35 ],
36
37 srcs: [
38 "applypatch.cpp",
39 "bspatch.cpp",
40 "freecache.cpp",
41 "imgpatch.cpp",
42 ],
43
44 export_include_dirs: [
45 "include",
46 ],
47
48 static_libs: [
49 "libbase",
50 "libbspatch",
51 "libbz",
52 "libcrypto",
53 "libedify",
54 "libotafault",
55 "libotautil",
56 "libz",
57 ],
58}
59
60cc_library_static {
61 name: "libapplypatch_modes",
62
63 defaults: [
64 "applypatch_defaults",
65 ],
66
67 srcs: [
68 "applypatch_modes.cpp",
69 ],
70
71 static_libs: [
72 "libapplypatch",
73 "libbase",
74 "libcrypto",
75 "libedify",
76 "libotautil",
77 ],
78}
79
80cc_binary {
81 name: "applypatch",
82
83 defaults: [
84 "applypatch_defaults",
85 ],
86
87 srcs: [
88 "applypatch_main.cpp",
89 ],
90
91 static_libs: [
92 "libapplypatch_modes",
93 "libapplypatch",
94 "libedify",
95 "libotafault",
96 "libotautil",
97 "libbspatch",
98 ],
99
100 shared_libs: [
101 "libbase",
102 "libbz",
103 "libcrypto",
104 "liblog",
105 "libz",
106 "libziparchive",
107 ],
108}
109
110cc_library_static {
111 name: "libimgdiff",
112
113 host_supported: true,
114
115 defaults: [
116 "applypatch_defaults",
117 ],
118
119 srcs: [
120 "imgdiff.cpp",
121 ],
122
123 export_include_dirs: [
124 "include",
125 ],
126
127 static_libs: [
128 "libbase",
129 "libbsdiff",
130 "libdivsufsort",
131 "libdivsufsort64",
132 "liblog",
133 "libotautil",
134 "libutils",
135 "libz",
136 "libziparchive",
137 ],
138}
139
140cc_binary_host {
141 name: "imgdiff",
142
143 srcs: [
144 "imgdiff_main.cpp",
145 ],
146
147 defaults: [
148 "applypatch_defaults",
149 ],
150
151 static_libs: [
152 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700153 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700154 "libbsdiff",
155 "libdivsufsort",
156 "libdivsufsort64",
157 "libziparchive",
158 "libbase",
159 "libutils",
160 "liblog",
161 "libbz",
162 "libz",
163 ],
164}
165
166cc_library_static {
167 name: "libimgpatch",
168
169 // The host module is for recovery_host_test (Linux only).
170 host_supported: true,
171
172 defaults: [
173 "applypatch_defaults",
174 ],
175
176 srcs: [
177 "bspatch.cpp",
178 "imgpatch.cpp",
179 ],
180
181 static_libs: [
182 "libbase",
183 "libbspatch",
184 "libbz",
185 "libcrypto",
186 "libedify",
187 "libotautil",
188 "libz",
189 ],
190
191 target: {
192 darwin: {
193 enabled: false,
194 },
195 },
196}