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", |
| 102 | "libbz", |
| 103 | "libcrypto", |
| 104 | "liblog", |
| 105 | "libz", |
| 106 | "libziparchive", |
| 107 | ], |
| 108 | } |
| 109 | |
| 110 | cc_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 | |
| 140 | cc_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", |
| 153 | "libbsdiff", |
| 154 | "libdivsufsort", |
| 155 | "libdivsufsort64", |
| 156 | "libziparchive", |
| 157 | "libbase", |
| 158 | "libutils", |
| 159 | "liblog", |
| 160 | "libbz", |
| 161 | "libz", |
| 162 | ], |
| 163 | } |
| 164 | |
| 165 | cc_library_static { |
| 166 | name: "libimgpatch", |
| 167 | |
| 168 | // The host module is for recovery_host_test (Linux only). |
| 169 | host_supported: true, |
| 170 | |
| 171 | defaults: [ |
| 172 | "applypatch_defaults", |
| 173 | ], |
| 174 | |
| 175 | srcs: [ |
| 176 | "bspatch.cpp", |
| 177 | "imgpatch.cpp", |
| 178 | ], |
| 179 | |
| 180 | static_libs: [ |
| 181 | "libbase", |
| 182 | "libbspatch", |
| 183 | "libbz", |
| 184 | "libcrypto", |
| 185 | "libedify", |
| 186 | "libotautil", |
| 187 | "libz", |
| 188 | ], |
| 189 | |
| 190 | target: { |
| 191 | darwin: { |
| 192 | enabled: false, |
| 193 | }, |
| 194 | }, |
| 195 | } |