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", |
| 53 | "libkeystore_binder", |
| 54 | "libkeyutils", |
| 55 | "liblog", |
| 56 | "liblogwrap", |
| 57 | "libselinux", |
| 58 | "libsysutils", |
| 59 | "libutils", |
| 60 | ], |
| 61 | } |
| 62 | |
| 63 | cc_library_static { |
| 64 | name: "libvold_binder", |
| 65 | defaults: ["vold_default_flags"], |
| 66 | |
| 67 | srcs: [ |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame^] | 68 | ":vold_aidl", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 69 | ], |
| 70 | shared_libs: [ |
| 71 | "libbinder", |
| 72 | "libutils", |
| 73 | ], |
| 74 | aidl: { |
| 75 | local_include_dirs: ["binder"], |
| 76 | include_dirs: ["frameworks/native/aidl/binder"], |
| 77 | export_aidl_headers: true, |
| 78 | }, |
| 79 | } |
| 80 | |
| 81 | // Static library factored out to support testing |
| 82 | cc_library_static { |
| 83 | name: "libvold", |
| 84 | defaults: [ |
| 85 | "vold_default_flags", |
| 86 | "vold_default_libs", |
| 87 | ], |
| 88 | |
| 89 | srcs: [ |
| 90 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 91 | "CheckEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 92 | "Devmapper.cpp", |
| 93 | "EncryptInplace.cpp", |
| 94 | "Ext4Crypt.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 95 | "FileDeviceUtils.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 96 | "IdleMaint.cpp", |
| 97 | "KeyBuffer.cpp", |
| 98 | "KeyStorage.cpp", |
| 99 | "KeyUtil.cpp", |
| 100 | "Keymaster.cpp", |
| 101 | "Loop.cpp", |
| 102 | "MetadataCrypt.cpp", |
| 103 | "MoveStorage.cpp", |
| 104 | "NetlinkHandler.cpp", |
| 105 | "NetlinkManager.cpp", |
| 106 | "Process.cpp", |
| 107 | "ScryptParameters.cpp", |
| 108 | "Utils.cpp", |
| 109 | "VoldNativeService.cpp", |
| 110 | "VoldUtil.cpp", |
| 111 | "VolumeManager.cpp", |
| 112 | "cryptfs.cpp", |
| 113 | "fs/Ext4.cpp", |
| 114 | "fs/F2fs.cpp", |
| 115 | "fs/Vfat.cpp", |
| 116 | "model/Disk.cpp", |
| 117 | "model/EmulatedVolume.cpp", |
| 118 | "model/ObbVolume.cpp", |
| 119 | "model/PrivateVolume.cpp", |
| 120 | "model/PublicVolume.cpp", |
| 121 | "model/VolumeBase.cpp", |
| 122 | "secontext.cpp", |
| 123 | ], |
| 124 | } |
| 125 | |
| 126 | cc_binary { |
| 127 | name: "vold", |
| 128 | defaults: [ |
| 129 | "vold_default_flags", |
| 130 | "vold_default_libs", |
| 131 | ], |
| 132 | |
| 133 | srcs: ["main.cpp"], |
| 134 | static_libs: ["libvold"], |
| 135 | init_rc: ["vold.rc"], |
| 136 | |
| 137 | required: [ |
| 138 | "mke2fs", |
| 139 | "vold_prepare_subdirs", |
| 140 | ], |
| 141 | } |
| 142 | |
| 143 | cc_binary { |
| 144 | name: "vdc", |
| 145 | defaults: ["vold_default_flags"], |
| 146 | |
| 147 | srcs: ["vdc.cpp"], |
| 148 | shared_libs: [ |
| 149 | "libbase", |
| 150 | "libbinder", |
| 151 | "libcutils", |
| 152 | "libutils", |
| 153 | ], |
| 154 | static_libs: [ |
| 155 | "libvold_binder", |
| 156 | ], |
| 157 | init_rc: ["vdc.rc"], |
| 158 | } |
| 159 | |
| 160 | cc_binary { |
| 161 | name: "secdiscard", |
| 162 | defaults: ["vold_default_flags"], |
| 163 | |
| 164 | srcs: [ |
| 165 | "FileDeviceUtils.cpp", |
| 166 | "secdiscard.cpp", |
| 167 | ], |
| 168 | shared_libs: ["libbase"], |
| 169 | } |
| 170 | |
| 171 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 172 | name: "vold_prepare_subdirs", |
| 173 | defaults: ["vold_default_flags"], |
| 174 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 175 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 176 | shared_libs: [ |
| 177 | "libbase", |
| 178 | "libcutils", |
| 179 | "liblogwrap", |
| 180 | "libselinux", |
| 181 | "libutils", |
| 182 | ], |
| 183 | static_libs: [ |
| 184 | "libvold_binder", |
| 185 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 186 | } |
| 187 | |
Colin Cross | a838863 | 2017-11-25 08:47:19 -0800 | [diff] [blame^] | 188 | filegroup { |
| 189 | name: "vold_aidl", |
| 190 | srcs: [ |
| 191 | "binder/android/os/IVold.aidl", |
| 192 | "binder/android/os/IVoldListener.aidl", |
| 193 | "binder/android/os/IVoldTaskListener.aidl", |
| 194 | ], |
| 195 | } |
| 196 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 197 | subdirs = ["tests"] |