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