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 | |
| 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 | |
| 60 | cc_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 | |
| 80 | cc_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", |
Tianjie Xu | 3d84386 | 2017-11-03 15:52:22 -0700 | [diff] [blame] | 102 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 103 | "libbz", |
| 104 | "libcrypto", |
| 105 | "liblog", |
| 106 | "libz", |
| 107 | "libziparchive", |
| 108 | ], |
| 109 | } |
| 110 | |
| 111 | cc_library_static { |
| 112 | name: "libimgdiff", |
| 113 | |
| 114 | host_supported: true, |
| 115 | |
| 116 | defaults: [ |
| 117 | "applypatch_defaults", |
| 118 | ], |
| 119 | |
| 120 | srcs: [ |
| 121 | "imgdiff.cpp", |
| 122 | ], |
| 123 | |
| 124 | export_include_dirs: [ |
| 125 | "include", |
| 126 | ], |
| 127 | |
| 128 | static_libs: [ |
| 129 | "libbase", |
| 130 | "libbsdiff", |
| 131 | "libdivsufsort", |
| 132 | "libdivsufsort64", |
| 133 | "liblog", |
| 134 | "libotautil", |
| 135 | "libutils", |
| 136 | "libz", |
| 137 | "libziparchive", |
| 138 | ], |
| 139 | } |
| 140 | |
| 141 | cc_binary_host { |
| 142 | name: "imgdiff", |
| 143 | |
| 144 | srcs: [ |
| 145 | "imgdiff_main.cpp", |
| 146 | ], |
| 147 | |
| 148 | defaults: [ |
| 149 | "applypatch_defaults", |
| 150 | ], |
| 151 | |
| 152 | static_libs: [ |
| 153 | "libimgdiff", |
Tao Bao | 4568582 | 2017-10-13 14:54:12 -0700 | [diff] [blame] | 154 | "libotautil", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 155 | "libbsdiff", |
| 156 | "libdivsufsort", |
| 157 | "libdivsufsort64", |
| 158 | "libziparchive", |
| 159 | "libbase", |
| 160 | "libutils", |
| 161 | "liblog", |
Tianjie Xu | 8c28081 | 2017-10-28 22:13:16 -0700 | [diff] [blame] | 162 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 163 | "libbz", |
| 164 | "libz", |
| 165 | ], |
| 166 | } |
| 167 | |
| 168 | cc_library_static { |
| 169 | name: "libimgpatch", |
| 170 | |
| 171 | // The host module is for recovery_host_test (Linux only). |
| 172 | host_supported: true, |
| 173 | |
| 174 | defaults: [ |
| 175 | "applypatch_defaults", |
| 176 | ], |
| 177 | |
| 178 | srcs: [ |
| 179 | "bspatch.cpp", |
| 180 | "imgpatch.cpp", |
| 181 | ], |
| 182 | |
| 183 | static_libs: [ |
| 184 | "libbase", |
| 185 | "libbspatch", |
| 186 | "libbz", |
| 187 | "libcrypto", |
| 188 | "libedify", |
| 189 | "libotautil", |
| 190 | "libz", |
| 191 | ], |
| 192 | |
| 193 | target: { |
| 194 | darwin: { |
| 195 | enabled: false, |
| 196 | }, |
| 197 | }, |
| 198 | } |