1// Copyright 2017 The Android Open Source Project 2 3// Library used to export files from this directory to other programs in this 4// project. 5package { 6 // See: http://go/android-license-faq 7 // A large-scale-change added 'default_applicable_licenses' to import 8 // all of the 'license_kinds' from "external_e2fsprogs_license" 9 // to get the below license kinds: 10 // SPDX-license-identifier-GPL 11 // SPDX-license-identifier-LGPL 12 // SPDX-license-identifier-LGPL-2.1 13 // SPDX-license-identifier-LGPL-3.0 14 default_applicable_licenses: ["external_e2fsprogs_license"], 15} 16 17cc_library { 18 name: "libext2_misc", 19 host_supported: true, 20 recovery_available: true, 21 vendor_available: true, 22 defaults: ["e2fsprogs-defaults"], 23 24 target: { 25 windows: { 26 enabled: true, 27 }, 28 }, 29 30 srcs: [ 31 "create_inode.c", 32 ], 33 shared_libs: [ 34 "libext2fs", 35 "libext2_com_err", 36 "libext2_quota", 37 ], 38 export_include_dirs: ["."], 39} 40 41//######################################################################## 42// Build mke2fs 43 44cc_defaults { 45 name: "mke2fs_defaults", 46 recovery_available: true, 47 defaults: ["e2fsprogs-defaults"], 48 49 srcs: [ 50 "mke2fs.c", 51 "util.c", 52 "mk_hugefiles.c", 53 "default_profile.c", 54 ], 55 stl: "libc++_static", 56 include_dirs: ["external/e2fsprogs/e2fsck"], 57} 58 59cc_binary { 60 name: "mke2fs", 61 host_supported: true, 62 vendor_available: true, 63 defaults: ["mke2fs_defaults"], 64 target: { 65 host: { 66 static_libs: [ 67 "libext2_blkid", 68 "libext2_misc", 69 "libext2_uuid", 70 "libext2_quota", 71 "libext2_com_err", 72 "libext2_e2p", 73 "libext2fs", 74 "libsparse", 75 "libbase", 76 "libz", 77 ], 78 }, 79 not_windows: { 80 required: [ 81 "mke2fs.conf", 82 ], 83 }, 84 windows: { 85 ldflags: ["-static"], 86 enabled: true, 87 }, 88 android: { 89 required: [ 90 "mke2fs.conf", 91 ], 92 shared_libs: [ 93 "libext2fs", 94 "libext2_blkid", 95 "libext2_misc", 96 "libext2_uuid", 97 "libext2_quota", 98 "libext2_com_err", 99 "libext2_e2p", 100 ], 101 symlinks: [ 102 "mkfs.ext2", 103 "mkfs.ext3", 104 "mkfs.ext4", 105 ], 106 }, 107 }, 108} 109 110cc_binary { 111 name: "mke2fs.microdroid", 112 defaults: ["mke2fs_defaults"], 113 bootstrap: true, 114 target: { 115 android: { 116 required: [ 117 "mke2fs.conf", 118 ], 119 shared_libs: [ 120 "libext2fs", 121 "libext2_blkid", 122 "libext2_misc", 123 "libext2_uuid", 124 "libext2_quota", 125 "libext2_com_err", 126 "libext2_e2p", 127 ], 128 symlinks: ["mkfs.ext4.microdroid"], 129 }, 130 }, 131 no_full_install: true, 132 stem: "mke2fs", 133 visibility: ["//packages/modules/Virtualization/microdroid"], 134} 135 136//########################################################################## 137// Build tune2fs 138 139cc_defaults { 140 name: "tune2fs-defaults", 141 defaults: ["e2fsprogs-defaults"], 142 srcs: [ 143 "tune2fs.c", 144 "util.c", 145 ], 146 cflags: ["-DNO_RECOVERY"], 147 include_dirs: ["external/e2fsprogs/e2fsck"], 148} 149 150tune2fs_libs = [ 151 "libext2_blkid", 152 "libext2_com_err", 153 "libext2_quota", 154 "libext2_uuid", 155 "libext2_e2p", 156 "libext2fs", 157] 158 159cc_binary { 160 name: "tune2fs", 161 host_supported: true, 162 vendor_ramdisk_available: true, 163 defaults: ["tune2fs-defaults"], 164 165 shared_libs: tune2fs_libs, 166} 167 168cc_binary { 169 name: "tune2fs_static", 170 static_executable: true, 171 defaults: ["tune2fs-defaults"], 172 173 static_libs: tune2fs_libs, 174} 175 176cc_binary { 177 name: "tune2fs_ramdisk", 178 stem: "tune2fs", 179 static_executable: true, 180 ramdisk: true, 181 defaults: ["tune2fs-defaults"], 182 static_libs: tune2fs_libs, 183} 184 185cc_library_static { 186 name: "libtune2fs", 187 defaults: ["tune2fs-defaults"], 188 189 cflags: ["-DBUILD_AS_LIB"], 190 static_libs: tune2fs_libs, 191} 192 193//######################################################################## 194// Build badblocks 195 196cc_binary_host { 197 name: "badblocks", 198 defaults: ["e2fsprogs-defaults"], 199 200 srcs: ["badblocks.c"], 201 shared_libs: [ 202 "libext2fs", 203 "libext2_com_err", 204 "libext2_uuid", 205 "libext2_blkid", 206 "libext2_e2p", 207 ], 208} 209 210//######################################################################## 211// Build chattr 212 213cc_binary { 214 name: "chattr-e2fsprogs", 215 host_supported: true, 216 defaults: ["e2fsprogs-defaults"], 217 218 srcs: ["chattr.c"], 219 shared_libs: [ 220 "libext2_com_err", 221 "libext2_e2p", 222 ], 223} 224 225//######################################################################## 226// Build lsattr 227 228cc_defaults { 229 name: "lsattr-defaults", 230 srcs: ["lsattr.c"], 231 defaults: ["e2fsprogs-defaults"], 232} 233 234lsattr_libs = [ 235 "libext2_com_err", 236 "libext2_e2p", 237] 238 239cc_binary { 240 name: "lsattr-e2fsprogs", 241 host_supported: true, 242 defaults: ["lsattr-defaults"], 243 244 shared_libs: lsattr_libs, 245} 246 247cc_binary { 248 name: "lsattr_static", 249 static_executable: true, 250 defaults: ["lsattr-defaults"], 251 252 static_libs: lsattr_libs, 253} 254 255//######################################################################## 256// Build blkid 257 258cc_binary { 259 name: "blkid", 260 host_supported: true, 261 defaults: ["e2fsprogs-defaults"], 262 263 srcs: ["blkid.c"], 264 shared_libs: [ 265 "libext2fs", 266 "libext2_blkid", 267 "libext2_com_err", 268 "libext2_e2p", 269 ], 270} 271 272cc_binary { 273 name: "blkid_static", 274 host_supported: true, 275 static_executable: true, 276 defaults: ["e2fsprogs-defaults"], 277 278 srcs: ["blkid.c"], 279 static_libs: [ 280 "libext2fs", 281 "libext2_blkid", 282 "libext2_com_err", 283 "libext2_e2p", 284 "libext2_uuid", 285 ], 286} 287 288//######################################################################## 289// Build e4crypt 290 291cc_binary { 292 name: "e4crypt", 293 host_supported: true, 294 defaults: ["e2fsprogs-defaults"], 295 296 srcs: ["e4crypt.c"], 297 shared_libs: [ 298 "libext2fs", 299 "libext2_uuid", 300 ], 301 302 target: { 303 darwin: { 304 enabled: false, 305 }, 306 }, 307} 308 309//########################################################################## 310// Build e2image 311 312cc_binary { 313 name: "e2image", 314 host_supported: true, 315 defaults: ["e2fsprogs-defaults"], 316 317 srcs: ["e2image.c"], 318 shared_libs: [ 319 "libext2fs", 320 "libext2_blkid", 321 "libext2_com_err", 322 "libext2_quota", 323 ], 324} 325 326//########################################################################## 327// Build filefrag 328 329cc_binary { 330 name: "filefrag", 331 host_supported: true, 332 defaults: ["e2fsprogs-defaults"], 333 334 srcs: ["filefrag.c"], 335 shared_libs: [ 336 "libext2fs", 337 ], 338} 339 340//########################################################################## 341// Build e2freefrag 342 343cc_binary { 344 name: "e2freefrag", 345 host_supported: true, 346 defaults: ["e2fsprogs-defaults"], 347 348 srcs: [ 349 "e2freefrag.c", 350 ], 351 header_libs: ["libext2-headers"], 352 shared_libs: [ 353 "libext2fs", 354 "libext2_com_err", 355 ], 356} 357