1// Copyright 2017 The Android Open Source Project 2 3package { 4 default_applicable_licenses: ["external_f2fs-tools_license"], 5} 6 7// Added automatically by a large-scale-change that took the approach of 8// 'apply every license found to every target'. While this makes sure we respect 9// every license restriction, it may not be entirely correct. 10// 11// e.g. GPL in an MIT project might only apply to the contrib/ directory. 12// 13// Please consider splitting the single license below into multiple licenses, 14// taking care not to lose any license_kind information, and overriding the 15// default license using the 'licenses: [...]' property on targets as needed. 16// 17// For unused files, consider creating a 'fileGroup' with "//visibility:private" 18// to attach the license to, and including a comment whether the files may be 19// used in the current project. 20// 21// large-scale-change included anything that looked like it might be a license 22// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 23// 24// Please consider removing redundant or irrelevant files from 'license_text:'. 25// See: http://go/android-license-faq 26license { 27 name: "external_f2fs-tools_license", 28 visibility: [":__subpackages__"], 29 license_kinds: [ 30 "SPDX-license-identifier-BSD", 31 "SPDX-license-identifier-GPL", 32 "SPDX-license-identifier-GPL-2.0", 33 "SPDX-license-identifier-LGPL", 34 "SPDX-license-identifier-LGPL-2.1", 35 ], 36 license_text: [ 37 "COPYING", 38 "NOTICE", 39 ], 40} 41 42cc_defaults { 43 name: "f2fs-tools-defaults", 44 cflags: [ 45 "-DF2FS_MAJOR_VERSION=1", 46 "-DF2FS_MINOR_VERSION=14", 47 "-DF2FS_TOOLS_VERSION=\"1.14.0\"", 48 "-DF2FS_TOOLS_DATE=\"2020-08-24\"", 49 "-DWITH_ANDROID", 50 "-Wall", 51 "-Werror", 52 "-Wno-format", 53 "-Wno-macro-redefined", 54 "-Wno-missing-field-initializers", 55 "-Wno-pointer-arith", 56 "-Wno-sign-compare", 57 "-Wno-unused-function", 58 "-Wno-string-plus-int", 59 ], 60 local_include_dirs: [ 61 "include", 62 "mkfs", 63 "fsck", 64 ], 65 include_dirs: [ 66 "external/e2fsprogs/lib/", 67 "external/e2fsprogs/lib/uuid", 68 "system/core/libsparse/include", 69 ], 70 target: { 71 windows: { 72 enabled: false, 73 }, 74 }, 75} 76 77cc_defaults { 78 name: "libf2fs_src_files", 79 cflags: ["-DWITH_BLKDISCARD"], 80 srcs: [ 81 "lib/libf2fs.c", 82 "mkfs/f2fs_format.c", 83 "mkfs/f2fs_format_utils.c", 84 "lib/libf2fs_zoned.c", 85 "lib/nls_utf8.c", 86 ], 87} 88 89cc_defaults { 90 name: "make_f2fs_src_files", 91 srcs: [ 92 "lib/libf2fs_io.c", 93 "mkfs/f2fs_format_main.c", 94 ], 95} 96 97cc_defaults { 98 name: "fsck_main_src_files", 99 srcs: [ 100 "fsck/dir.c", 101 "fsck/dict.c", 102 "fsck/mkquota.c", 103 "fsck/quotaio.c", 104 "fsck/quotaio_tree.c", 105 "fsck/quotaio_v2.c", 106 "fsck/node.c", 107 "fsck/segment.c", 108 "fsck/xattr.c", 109 "fsck/main.c", 110 "fsck/mount.c", 111 "lib/libf2fs.c", 112 "lib/libf2fs_io.c", 113 "lib/libf2fs_zoned.c", 114 "lib/nls_utf8.c", 115 "fsck/dump.c", 116 ], 117} 118 119cc_library_static { 120 name: "libf2fs_fmt", 121 recovery_available: true, 122 defaults: [ 123 "f2fs-tools-defaults", 124 "libf2fs_src_files" 125 ], 126} 127 128cc_library_host_static { 129 name: "libf2fs_fmt_host", 130 defaults: [ 131 "f2fs-tools-defaults", 132 "libf2fs_src_files" 133 ], 134 target: { 135 windows: { 136 include_dirs: [ "external/e2fsprogs/include/mingw" ], 137 cflags: [ 138 "-DANDROID_WINDOWS_HOST", 139 "-Wno-typedef-redefinition", 140 "-Wno-unused-parameter", 141 ], 142 enabled: true 143 }, 144 }, 145} 146 147cc_defaults { 148 name: "make_f2fs_defaults", 149 defaults: [ 150 "f2fs-tools-defaults", 151 "make_f2fs_src_files", 152 ], 153 host_supported: true, 154 recovery_available: true, 155 target: { 156 android: { 157 static_libs: [ 158 "libf2fs_fmt", 159 ], 160 shared_libs: [ 161 "libext2_uuid", 162 "libsparse", 163 "libbase", 164 ], 165 }, 166 host: { 167 static_libs: [ 168 "libf2fs_fmt_host", 169 "libext2_uuid", 170 "libsparse", 171 "libbase", 172 "libz", 173 ], 174 }, 175 windows: { 176 include_dirs: [ "external/e2fsprogs/include/mingw" ], 177 cflags: ["-DANDROID_WINDOWS_HOST"], 178 ldflags: ["-static"], 179 host_ldlibs: ["-lws2_32"], 180 enabled: true 181 }, 182 }, 183} 184 185cc_binary { 186 name: "make_f2fs", 187 defaults: [ 188 "make_f2fs_defaults", 189 ], 190} 191 192cc_binary_host { 193 name: "make_f2fs_casefold", 194 defaults: [ 195 "make_f2fs_defaults", 196 ], 197 target: { 198 host: { 199 cflags: ["-DCONF_CASEFOLD", "-DCONF_PROJID"], 200 }, 201 windows: { 202 cflags: ["-DCONF_CASEFOLD", "-DCONF_PROJID"], 203 }, 204 }, 205} 206 207cc_binary_host { 208 name: "make_f2fs.static", 209 defaults: [ 210 "make_f2fs_defaults", 211 ], 212 static_executable: true, 213 stl: "libc++_static", 214} 215 216cc_binary { 217 name: "fsck.f2fs", 218 defaults: [ 219 "f2fs-tools-defaults", 220 "fsck_main_src_files", 221 ], 222 host_supported: true, 223 recovery_available: true, 224 cflags: ["-DWITH_RESIZE", "-DWITH_DEFRAG", "-DWITH_DUMP"], 225 srcs: ["fsck/fsck.c", "fsck/resize.c", "fsck/defrag.c"], 226 shared_libs: [ 227 "libext2_uuid", 228 "libsparse", 229 "libbase", 230 ], 231 symlinks: ["resize.f2fs", "defrag.f2fs", "dump.f2fs"], 232 vendor_ramdisk_available: true, 233} 234 235cc_binary { 236 name: "sload_f2fs", 237 defaults: [ 238 "f2fs-tools-defaults", 239 "fsck_main_src_files", 240 ], 241 host_supported: true, 242 recovery_available: true, 243 cflags: ["-DWITH_SLOAD"], 244 srcs: [ 245 "fsck/fsck.c", 246 "fsck/sload.c", 247 "fsck/compress.c", 248 ], 249 target: { 250 android: { 251 shared_libs: [ 252 "libext2_uuid", 253 "libsparse", 254 "libbase", 255 "libcrypto", 256 "libselinux", 257 "libcutils", 258 "liblog", 259 "liblz4", 260 ], 261 }, 262 host: { 263 static_libs: [ 264 "libext2_uuid", 265 "libsparse", 266 "libbase", 267 "libcrypto", 268 "libselinux", 269 "libcutils", 270 "liblog", 271 "libz", 272 "liblz4", 273 ], 274 }, 275 }, 276 stl: "libc++_static", 277} 278 279cc_binary { 280 name: "check_f2fs", 281 host_supported: false, 282 cflags: [ 283 "--static", 284 "-U_FORTIFY_SOURCE", 285 ], 286 srcs: ["tools/check_f2fs.c"], 287 product_specific: true, 288} 289 290cc_defaults { 291 name: "tools-defaults", 292 cflags: [ 293 "-Wno-unused-function", 294 ], 295 local_include_dirs: [ 296 "include", 297 ], 298 target: { 299 windows: { 300 enabled: false, 301 }, 302 darwin: { 303 enabled: false, 304 }, 305 }, 306 product_specific: true, 307} 308 309cc_binary { 310 name: "f2fscrypt", 311 defaults: [ 312 "tools-defaults", 313 ], 314 shared_libs: [ 315 "libext2_uuid", 316 ], 317 srcs: [ 318 "tools/f2fscrypt.c", 319 "tools/sha512.c", 320 ], 321} 322 323cc_binary { 324 name: "f2fsstat", 325 defaults: [ 326 "tools-defaults", 327 ], 328 srcs: [ 329 "tools/f2fstat.c", 330 ], 331} 332 333cc_binary { 334 name: "f2fs.fibmap", 335 defaults: [ 336 "tools-defaults", 337 ], 338 srcs: [ 339 "tools/fibmap.c", 340 ], 341} 342