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, |
Bill Peckham | 341644d | 2019-09-17 17:11:50 -0700 | [diff] [blame] | 34 | vendor_available: true, |
Tianjie Xu | e40c80d | 2018-02-03 17:20:56 -0800 | [diff] [blame] | 35 | |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 36 | 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 Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 55 | "libedify", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 56 | "libotautil", |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 57 | "libz_stable", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 58 | ], |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 59 | |
Pete Bentley | 189d424 | 2019-09-12 19:53:46 +0100 | [diff] [blame] | 60 | shared_libs: [ |
| 61 | "libcrypto", |
| 62 | ], |
| 63 | |
Tianjie Xu | 7a4dacf | 2018-02-17 21:58:54 -0800 | [diff] [blame] | 64 | target: { |
| 65 | darwin: { |
| 66 | enabled: false, |
| 67 | }, |
| 68 | }, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | cc_library_static { |
| 72 | name: "libapplypatch_modes", |
Bill Peckham | 341644d | 2019-09-17 17:11:50 -0700 | [diff] [blame] | 73 | vendor_available: true, |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 74 | host_supported: true, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 75 | |
| 76 | defaults: [ |
| 77 | "applypatch_defaults", |
| 78 | ], |
| 79 | |
| 80 | srcs: [ |
| 81 | "applypatch_modes.cpp", |
| 82 | ], |
| 83 | |
| 84 | static_libs: [ |
| 85 | "libapplypatch", |
| 86 | "libbase", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 87 | "libedify", |
| 88 | "libotautil", |
| 89 | ], |
Pete Bentley | 189d424 | 2019-09-12 19:53:46 +0100 | [diff] [blame] | 90 | |
| 91 | shared_libs: [ |
| 92 | "libcrypto", |
| 93 | ], |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | cc_binary { |
| 97 | name: "applypatch", |
Bill Peckham | 341644d | 2019-09-17 17:11:50 -0700 | [diff] [blame] | 98 | vendor: true, |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 99 | host_supported: true, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 100 | |
| 101 | defaults: [ |
| 102 | "applypatch_defaults", |
| 103 | ], |
| 104 | |
| 105 | srcs: [ |
| 106 | "applypatch_main.cpp", |
| 107 | ], |
| 108 | |
| 109 | static_libs: [ |
| 110 | "libapplypatch_modes", |
| 111 | "libapplypatch", |
| 112 | "libedify", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 113 | "libotautil", |
Tao Bao | 71c35b9 | 2019-09-23 08:58:44 -0700 | [diff] [blame] | 114 | |
| 115 | // External dependencies. |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 116 | "libbspatch", |
Tao Bao | 71c35b9 | 2019-09-23 08:58:44 -0700 | [diff] [blame] | 117 | "libbrotli", |
| 118 | "libbz", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 119 | ], |
| 120 | |
| 121 | shared_libs: [ |
| 122 | "libbase", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 123 | "libcrypto", |
| 124 | "liblog", |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 125 | "libz_stable", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 126 | "libziparchive", |
| 127 | ], |
Bill Peckham | 341644d | 2019-09-17 17:11:50 -0700 | [diff] [blame] | 128 | |
| 129 | init_rc: [ |
| 130 | "vendor_flash_recovery.rc", |
| 131 | ], |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 134 | cc_library_static { |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 135 | name: "libimgdiff", |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 136 | host_supported: true, |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 137 | defaults: [ |
| 138 | "applypatch_defaults", |
| 139 | ], |
| 140 | |
| 141 | srcs: [ |
| 142 | "imgdiff.cpp", |
| 143 | ], |
| 144 | |
| 145 | export_include_dirs: [ |
| 146 | "include", |
| 147 | ], |
| 148 | |
| 149 | static_libs: [ |
| 150 | "libbase", |
| 151 | "libbsdiff", |
| 152 | "libdivsufsort", |
| 153 | "libdivsufsort64", |
| 154 | "liblog", |
| 155 | "libotautil", |
| 156 | "libutils", |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 157 | "libz_stable", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 158 | "libziparchive", |
| 159 | ], |
| 160 | } |
| 161 | |
| 162 | cc_binary_host { |
| 163 | name: "imgdiff", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 164 | srcs: [ |
| 165 | "imgdiff_main.cpp", |
| 166 | ], |
| 167 | |
| 168 | defaults: [ |
| 169 | "applypatch_defaults", |
| 170 | ], |
| 171 | |
| 172 | static_libs: [ |
| 173 | "libimgdiff", |
Tao Bao | 4568582 | 2017-10-13 14:54:12 -0700 | [diff] [blame] | 174 | "libotautil", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 175 | "libbsdiff", |
| 176 | "libdivsufsort", |
| 177 | "libdivsufsort64", |
| 178 | "libziparchive", |
| 179 | "libbase", |
| 180 | "libutils", |
| 181 | "liblog", |
Tianjie Xu | 8c28081 | 2017-10-28 22:13:16 -0700 | [diff] [blame] | 182 | "libbrotli", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 183 | "libbz", |
Kelvin Zhang | 2f2749f | 2021-01-12 14:42:56 -0500 | [diff] [blame] | 184 | "libz_stable", |
Tao Bao | 582b678 | 2017-10-05 09:06:21 -0700 | [diff] [blame] | 185 | ], |
| 186 | } |