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 | ], |
| 138 | }, |
| 139 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | cc_binary { |
| 143 | name: "vold", |
| 144 | defaults: [ |
| 145 | "vold_default_flags", |
| 146 | "vold_default_libs", |
| 147 | ], |
| 148 | |
| 149 | srcs: ["main.cpp"], |
| 150 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame] | 151 | product_variables: { |
| 152 | arc: { |
| 153 | static_libs: [ |
| 154 | "libarcobbvolume", |
| 155 | ] |
| 156 | }, |
| 157 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 158 | init_rc: ["vold.rc"], |
| 159 | |
| 160 | required: [ |
| 161 | "mke2fs", |
| 162 | "vold_prepare_subdirs", |
| 163 | ], |
| 164 | } |
| 165 | |
| 166 | cc_binary { |
| 167 | name: "vdc", |
| 168 | defaults: ["vold_default_flags"], |
| 169 | |
| 170 | srcs: ["vdc.cpp"], |
| 171 | shared_libs: [ |
| 172 | "libbase", |
| 173 | "libbinder", |
| 174 | "libcutils", |
| 175 | "libutils", |
| 176 | ], |
| 177 | static_libs: [ |
| 178 | "libvold_binder", |
| 179 | ], |
| 180 | init_rc: ["vdc.rc"], |
| 181 | } |
| 182 | |
| 183 | cc_binary { |
| 184 | name: "secdiscard", |
| 185 | defaults: ["vold_default_flags"], |
| 186 | |
| 187 | srcs: [ |
| 188 | "FileDeviceUtils.cpp", |
| 189 | "secdiscard.cpp", |
| 190 | ], |
| 191 | shared_libs: ["libbase"], |
| 192 | } |
| 193 | |
| 194 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 195 | name: "vold_prepare_subdirs", |
| 196 | defaults: ["vold_default_flags"], |
| 197 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 198 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 199 | shared_libs: [ |
| 200 | "libbase", |
| 201 | "libcutils", |
| 202 | "liblogwrap", |
| 203 | "libselinux", |
| 204 | "libutils", |
| 205 | ], |
| 206 | static_libs: [ |
| 207 | "libvold_binder", |
| 208 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 209 | } |
| 210 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame] | 211 | filegroup { |
| 212 | name: "vold_aidl", |
| 213 | srcs: [ |
| 214 | "binder/android/os/IVold.aidl", |
| 215 | "binder/android/os/IVoldListener.aidl", |
| 216 | "binder/android/os/IVoldTaskListener.aidl", |
| 217 | ], |
| 218 | } |
| 219 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 220 | subdirs = ["tests"] |