Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "vold_default_flags", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
| 7 | "-Wextra", |
| 8 | "-Wno-missing-field-initializers", |
| 9 | "-Wno-unused-parameter", |
| 10 | "-Wno-unused-variable", |
| 11 | ], |
| 12 | |
| 13 | clang: true, |
| 14 | |
| 15 | tidy: true, |
| 16 | tidy_checks: [ |
| 17 | "-*", |
| 18 | "cert-*", |
| 19 | "clang-analyzer-security*", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 20 | ], |
| 21 | tidy_flags: [ |
| 22 | "-warnings-as-errors=clang-analyzer-security*,cert-*", |
| 23 | ], |
| 24 | } |
| 25 | |
| 26 | cc_defaults { |
| 27 | name: "vold_default_libs", |
| 28 | |
| 29 | static_libs: [ |
| 30 | "libavb", |
| 31 | "libbootloader_message", |
| 32 | "libfec", |
| 33 | "libfec_rs", |
| 34 | "libfs_mgr", |
| 35 | "libscrypt_static", |
| 36 | "libsquashfs_utils", |
| 37 | "libvold_binder", |
| 38 | ], |
| 39 | shared_libs: [ |
| 40 | "android.hardware.keymaster@3.0", |
| 41 | "libbase", |
| 42 | "libbinder", |
| 43 | "libcrypto", |
| 44 | "libcrypto_utils", |
| 45 | "libcutils", |
| 46 | "libdiskconfig", |
| 47 | "libext4_utils", |
| 48 | "libf2fs_sparseblock", |
| 49 | "libhardware", |
| 50 | "libhardware_legacy", |
| 51 | "libhidlbase", |
| 52 | "libhwbinder", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 53 | "libkeyutils", |
| 54 | "liblog", |
| 55 | "liblogwrap", |
| 56 | "libselinux", |
| 57 | "libsysutils", |
| 58 | "libutils", |
| 59 | ], |
| 60 | } |
| 61 | |
| 62 | cc_library_static { |
| 63 | name: "libvold_binder", |
| 64 | defaults: ["vold_default_flags"], |
| 65 | |
| 66 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 67 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 68 | ], |
| 69 | shared_libs: [ |
| 70 | "libbinder", |
| 71 | "libutils", |
| 72 | ], |
| 73 | aidl: { |
| 74 | local_include_dirs: ["binder"], |
| 75 | include_dirs: ["frameworks/native/aidl/binder"], |
| 76 | export_aidl_headers: true, |
| 77 | }, |
| 78 | } |
| 79 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 80 | cc_library_headers { |
| 81 | name: "libvold_headers", |
| 82 | export_include_dirs: ["."], |
| 83 | } |
| 84 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 85 | // Static library factored out to support testing |
| 86 | cc_library_static { |
| 87 | name: "libvold", |
| 88 | defaults: [ |
| 89 | "vold_default_flags", |
| 90 | "vold_default_libs", |
| 91 | ], |
| 92 | |
| 93 | srcs: [ |
| 94 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 95 | "CheckEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 96 | "Devmapper.cpp", |
| 97 | "EncryptInplace.cpp", |
| 98 | "Ext4Crypt.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 99 | "FileDeviceUtils.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 100 | "IdleMaint.cpp", |
| 101 | "KeyBuffer.cpp", |
| 102 | "KeyStorage.cpp", |
| 103 | "KeyUtil.cpp", |
| 104 | "Keymaster.cpp", |
| 105 | "Loop.cpp", |
| 106 | "MetadataCrypt.cpp", |
| 107 | "MoveStorage.cpp", |
| 108 | "NetlinkHandler.cpp", |
| 109 | "NetlinkManager.cpp", |
| 110 | "Process.cpp", |
| 111 | "ScryptParameters.cpp", |
| 112 | "Utils.cpp", |
| 113 | "VoldNativeService.cpp", |
| 114 | "VoldUtil.cpp", |
| 115 | "VolumeManager.cpp", |
Shawn Willden | f452774 | 2017-11-09 15:59:39 -0700 | [diff] [blame] | 116 | "authorization_set.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 117 | "cryptfs.cpp", |
Jeff Sharkey | 37ba125 | 2018-01-19 10:55:18 +0900 | [diff] [blame] | 118 | "fs/Exfat.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 119 | "fs/Ext4.cpp", |
| 120 | "fs/F2fs.cpp", |
| 121 | "fs/Vfat.cpp", |
| 122 | "model/Disk.cpp", |
| 123 | "model/EmulatedVolume.cpp", |
| 124 | "model/ObbVolume.cpp", |
| 125 | "model/PrivateVolume.cpp", |
| 126 | "model/PublicVolume.cpp", |
| 127 | "model/VolumeBase.cpp", |
| 128 | "secontext.cpp", |
| 129 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 130 | product_variables: { |
| 131 | arc: { |
| 132 | exclude_srcs: [ |
| 133 | "model/ObbVolume.cpp", |
| 134 | ], |
| 135 | static_libs: [ |
| 136 | "libarcobbvolume", |
| 137 | ], |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame^] | 138 | shared_libs: [ |
| 139 | "libarcmounter", |
| 140 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 141 | }, |
| 142 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | cc_binary { |
| 146 | name: "vold", |
| 147 | defaults: [ |
| 148 | "vold_default_flags", |
| 149 | "vold_default_libs", |
| 150 | ], |
| 151 | |
| 152 | srcs: ["main.cpp"], |
| 153 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 154 | product_variables: { |
| 155 | arc: { |
| 156 | static_libs: [ |
| 157 | "libarcobbvolume", |
Risan | 9929e7d | 2018-01-22 11:04:25 +0900 | [diff] [blame^] | 158 | ], |
| 159 | shared_libs: [ |
| 160 | "libarcmounter", |
| 161 | ], |
| 162 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 163 | }, |
| 164 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 165 | init_rc: ["vold.rc"], |
| 166 | |
| 167 | required: [ |
| 168 | "mke2fs", |
| 169 | "vold_prepare_subdirs", |
| 170 | ], |
| 171 | } |
| 172 | |
| 173 | cc_binary { |
| 174 | name: "vdc", |
| 175 | defaults: ["vold_default_flags"], |
| 176 | |
| 177 | srcs: ["vdc.cpp"], |
| 178 | shared_libs: [ |
| 179 | "libbase", |
| 180 | "libbinder", |
| 181 | "libcutils", |
| 182 | "libutils", |
| 183 | ], |
| 184 | static_libs: [ |
| 185 | "libvold_binder", |
| 186 | ], |
| 187 | init_rc: ["vdc.rc"], |
| 188 | } |
| 189 | |
| 190 | cc_binary { |
| 191 | name: "secdiscard", |
| 192 | defaults: ["vold_default_flags"], |
| 193 | |
| 194 | srcs: [ |
| 195 | "FileDeviceUtils.cpp", |
| 196 | "secdiscard.cpp", |
| 197 | ], |
| 198 | shared_libs: ["libbase"], |
| 199 | } |
| 200 | |
| 201 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 202 | name: "vold_prepare_subdirs", |
| 203 | defaults: ["vold_default_flags"], |
| 204 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 205 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 206 | shared_libs: [ |
| 207 | "libbase", |
| 208 | "libcutils", |
| 209 | "liblogwrap", |
| 210 | "libselinux", |
| 211 | "libutils", |
| 212 | ], |
| 213 | static_libs: [ |
| 214 | "libvold_binder", |
| 215 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 216 | } |
| 217 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 218 | filegroup { |
| 219 | name: "vold_aidl", |
| 220 | srcs: [ |
| 221 | "binder/android/os/IVold.aidl", |
| 222 | "binder/android/os/IVoldListener.aidl", |
| 223 | "binder/android/os/IVoldTaskListener.aidl", |
| 224 | ], |
| 225 | } |
| 226 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 227 | subdirs = ["tests"] |