blob: 13a962584498bd90262c3465f187c515bd7ee95e [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,
Bill Peckham341644d2019-09-17 17:11:50 -070034 vendor_available: true,
Tianjie Xue40c80d2018-02-03 17:20:56 -080035
Tao Bao582b6782017-10-05 09:06:21 -070036 defaults: [
37 "applypatch_defaults",
38 ],
39
40 srcs: [
41 "applypatch.cpp",
42 "bspatch.cpp",
43 "freecache.cpp",
44 "imgpatch.cpp",
45 ],
46
47 export_include_dirs: [
48 "include",
49 ],
50
51 static_libs: [
52 "libbase",
53 "libbspatch",
54 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -070055 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -070056 "libotautil",
57 "libz",
58 ],
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080059
Pete Bentley189d4242019-09-12 19:53:46 +010060 shared_libs: [
61 "libcrypto",
62 ],
63
Tianjie Xu7a4dacf2018-02-17 21:58:54 -080064 target: {
65 darwin: {
66 enabled: false,
67 },
68 },
Tao Bao582b6782017-10-05 09:06:21 -070069}
70
71cc_library_static {
72 name: "libapplypatch_modes",
Bill Peckham341644d2019-09-17 17:11:50 -070073 vendor_available: true,
Tao Bao582b6782017-10-05 09:06:21 -070074
75 defaults: [
76 "applypatch_defaults",
77 ],
78
79 srcs: [
80 "applypatch_modes.cpp",
81 ],
82
83 static_libs: [
84 "libapplypatch",
85 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -070086 "libedify",
87 "libotautil",
88 ],
Pete Bentley189d4242019-09-12 19:53:46 +010089
90 shared_libs: [
91 "libcrypto",
92 ],
Tao Bao582b6782017-10-05 09:06:21 -070093}
94
95cc_binary {
96 name: "applypatch",
Bill Peckham341644d2019-09-17 17:11:50 -070097 vendor: true,
Tao Bao582b6782017-10-05 09:06:21 -070098
99 defaults: [
100 "applypatch_defaults",
101 ],
102
103 srcs: [
104 "applypatch_main.cpp",
105 ],
106
107 static_libs: [
108 "libapplypatch_modes",
109 "libapplypatch",
110 "libedify",
Tao Bao582b6782017-10-05 09:06:21 -0700111 "libotautil",
Tao Bao71c35b92019-09-23 08:58:44 -0700112
113 // External dependencies.
Tao Bao582b6782017-10-05 09:06:21 -0700114 "libbspatch",
Tao Bao71c35b92019-09-23 08:58:44 -0700115 "libbrotli",
116 "libbz",
Tao Bao582b6782017-10-05 09:06:21 -0700117 ],
118
119 shared_libs: [
120 "libbase",
Tao Bao582b6782017-10-05 09:06:21 -0700121 "libcrypto",
122 "liblog",
123 "libz",
124 "libziparchive",
125 ],
Bill Peckham341644d2019-09-17 17:11:50 -0700126
127 init_rc: [
128 "vendor_flash_recovery.rc",
129 ],
Tao Bao582b6782017-10-05 09:06:21 -0700130}
131
Tianjie Xu42d77792019-06-28 11:04:07 -0700132cc_library_host_static {
Tao Bao582b6782017-10-05 09:06:21 -0700133 name: "libimgdiff",
134
Tao Bao582b6782017-10-05 09:06:21 -0700135 defaults: [
136 "applypatch_defaults",
137 ],
138
139 srcs: [
140 "imgdiff.cpp",
141 ],
142
143 export_include_dirs: [
144 "include",
145 ],
146
147 static_libs: [
148 "libbase",
149 "libbsdiff",
150 "libdivsufsort",
151 "libdivsufsort64",
152 "liblog",
153 "libotautil",
154 "libutils",
155 "libz",
156 "libziparchive",
157 ],
158}
159
160cc_binary_host {
161 name: "imgdiff",
162
163 srcs: [
164 "imgdiff_main.cpp",
165 ],
166
167 defaults: [
168 "applypatch_defaults",
169 ],
170
171 static_libs: [
172 "libimgdiff",
Tao Bao45685822017-10-13 14:54:12 -0700173 "libotautil",
Tao Bao582b6782017-10-05 09:06:21 -0700174 "libbsdiff",
175 "libdivsufsort",
176 "libdivsufsort64",
177 "libziparchive",
178 "libbase",
179 "libutils",
180 "liblog",
Tianjie Xu8c280812017-10-28 22:13:16 -0700181 "libbrotli",
Tao Bao582b6782017-10-05 09:06:21 -0700182 "libbz",
183 "libz",
184 ],
185}