• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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    host_supported: true,
34
35    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    target: {
62        darwin: {
63            enabled: false,
64        },
65    },
66}
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",
110        "libbrotli",
111        "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",
162        "libotautil",
163        "libbsdiff",
164        "libdivsufsort",
165        "libdivsufsort64",
166        "libziparchive",
167        "libbase",
168        "libutils",
169        "liblog",
170        "libbrotli",
171        "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}
207