Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 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 | |
| 15 | cc_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 | |
| 30 | cc_library_static { |
| 31 | name: "libapplypatch", |
| 32 | |
Tianjie Xu | e40c80d | 2018-02-03 17:20:56 -0800 | [diff] [blame] | 33 | host_supported: true, |
| 34 | |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 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", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 56 | "libotautil", |
| 57 | "libz", |
| 58 | ], |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 59 | |
| 60 | target: { |
| 61 | darwin: { |
| 62 | enabled: false, |
| 63 | }, |
| 64 | }, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | cc_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 | |
| 87 | cc_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 Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 102 | "libotautil", |
| 103 | "libbspatch", |
| 104 | ], |
| 105 | |
| 106 | shared_libs: [ |
| 107 | "libbase", |
Tianjie Xu | 3d84386 | 2017-11-03 15:52:22 -0700 | [diff] [blame] | 108 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 109 | "libbz", |
| 110 | "libcrypto", |
| 111 | "liblog", |
| 112 | "libz", |
| 113 | "libziparchive", |
| 114 | ], |
| 115 | } |
| 116 | |
| 117 | cc_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 | |
| 147 | cc_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 Bao | 4568582 | 2017-10-13 14:54:12 -0700 | [diff] [blame] | 160 | "libotautil", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 161 | "libbsdiff", |
| 162 | "libdivsufsort", |
| 163 | "libdivsufsort64", |
| 164 | "libziparchive", |
| 165 | "libbase", |
| 166 | "libutils", |
| 167 | "liblog", |
Tianjie Xu | 8c28081 | 2017-10-28 22:13:16 -0700 | [diff] [blame] | 168 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 169 | "libbz", |
| 170 | "libz", |
| 171 | ], |
| 172 | } |
| 173 | |
| 174 | cc_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 | } |