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