1// 2// Copyright (C) 2020 Gao Xiang 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15 16package { 17 default_applicable_licenses: ["external_erofs-utils_license"], 18} 19 20// Added automatically by a large-scale-change that took the approach of 21// 'apply every license found to every target'. While this makes sure we respect 22// every license restriction, it may not be entirely correct. 23// 24// e.g. GPL in an MIT project might only apply to the contrib/ directory. 25// 26// Please consider splitting the single license below into multiple licenses, 27// taking care not to lose any license_kind information, and overriding the 28// default license using the 'licenses: [...]' property on targets as needed. 29// 30// For unused files, consider creating a 'fileGroup' with "//visibility:private" 31// to attach the license to, and including a comment whether the files may be 32// used in the current project. 33// See: http://go/android-license-faq 34license { 35 name: "external_erofs-utils_license", 36 visibility: [":__subpackages__"], 37 license_kinds: [ 38 "SPDX-license-identifier-GPL", 39 "SPDX-license-identifier-GPL-2.0", 40 "SPDX-license-identifier-LGPL", 41 ], 42 license_text: [ 43 "COPYING", 44 ], 45} 46 47genrule { 48 name: "erofs-utils-version.h", 49 srcs: ["VERSION"], 50 out: ["erofs-utils-version.h"], 51 cmd: "sed -n '1p' $(in) | tr -d '\n' | sed 's/\\(.*\\)/#define PACKAGE_VERSION \"\\1\"/' > $(out)", 52} 53 54cc_defaults { 55 name: "erofs-utils_export_defaults", 56 57 cflags: [ 58 "-Wall", 59 "-Werror", 60 "-Wno-error=#warnings", 61 "-Wno-ignored-qualifiers", 62 "-Wno-pointer-arith", 63 "-Wno-unused-parameter", 64 "-Wno-unused-function", 65 "-DHAVE_FALLOCATE", 66 "-DHAVE_LINUX_TYPES_H", 67 "-DHAVE_LIBSELINUX", 68 "-DHAVE_LIBUUID", 69 "-DLZ4_ENABLED", 70 "-DLZ4HC_ENABLED", 71 "-DWITH_ANDROID", 72 "-DHAVE_MEMRCHR", 73 "-DHAVE_SYS_IOCTL_H", 74 "-DHAVE_LLISTXATTR", 75 "-DHAVE_LGETXATTR", 76 "-D_FILE_OFFSET_BITS=64", 77 "-DEROFS_MAX_BLOCK_SIZE=16384", 78 "-DHAVE_UTIMENSAT", 79 "-DHAVE_UNISTD_H", 80 "-DHAVE_SYSCONF", 81 "-DEROFS_MT_ENABLED", 82 ], 83} 84 85cc_defaults { 86 name: "erofs-utils_defaults", 87 defaults: ["erofs-utils_export_defaults"], 88 89 cflags: [ 90 "-include erofs-utils-version.h", 91 ], 92 local_include_dirs: [ 93 "include", 94 ], 95 include_dirs: [ 96 "external/e2fsprogs/lib/", 97 ], 98 generated_headers: ["erofs-utils-version.h"], 99 target: { 100 android: { 101 shared_libs: [ 102 "libbase", 103 "libcutils", 104 "libext2_uuid", 105 "liblog", 106 "liblz4", 107 "libselinux", 108 ], 109 stl: "none", 110 }, 111 host: { 112 static_libs: [ 113 "libbase", 114 "libcutils", 115 "libext2_uuid", 116 "liblog", 117 "liblz4", 118 "libselinux", 119 ], 120 stl: "c++_static", 121 }, 122 }, 123} 124 125cc_library { 126 host_supported: true, 127 recovery_available: true, 128 name: "liberofs", 129 defaults: ["erofs-utils_defaults"], 130 srcs: [ 131 "lib/*.c", 132 ], 133 exclude_srcs: [ 134 "lib/compressor_libdeflate.c", 135 "lib/compressor_libzstd.c", 136 ], 137 export_include_dirs: ["include"], 138 139 target: { 140 darwin: { 141 enabled: false, 142 }, 143 }, 144} 145 146cc_defaults { 147 name: "mkfs-erofs_defaults", 148 149 defaults: ["erofs-utils_defaults"], 150 151 srcs: [ 152 "mkfs/*.c", 153 ], 154 static_libs: [ 155 "liberofs", 156 ], 157 158 target: { 159 darwin: { 160 enabled: false, 161 }, 162 }, 163} 164 165cc_binary { 166 name: "mkfs.erofs", 167 168 defaults: ["mkfs-erofs_defaults"], 169 host_supported: true, 170} 171 172cc_binary { 173 name: "mkfs.erofs.recovery", 174 defaults: ["mkfs-erofs_defaults"], 175 recovery: true, 176 stem: "mkfs.erofs", 177} 178 179cc_defaults { 180 name: "dump.erofs_defaults", 181 defaults: ["erofs-utils_defaults"], 182 srcs: [ 183 "dump/*.c", 184 ], 185 static_libs: [ 186 "liberofs", 187 ], 188} 189 190cc_binary { 191 name: "dump.erofs", 192 defaults: ["dump.erofs_defaults"], 193 host_supported: true, 194 target: { 195 darwin: { 196 enabled: false, 197 }, 198 }, 199} 200 201cc_binary { 202 name: "dump.erofs.recovery", 203 defaults: ["dump.erofs_defaults"], 204 recovery: true, 205 stem: "dump.erofs", 206} 207 208cc_defaults { 209 name: "fsck.erofs_defaults", 210 defaults: ["erofs-utils_defaults"], 211 srcs: [ 212 "fsck/*.c", 213 ], 214 static_libs: [ 215 "liberofs", 216 ], 217} 218 219cc_binary { 220 name: "fsck.erofs", 221 defaults: ["fsck.erofs_defaults"], 222 host_supported: true, 223 target: { 224 darwin: { 225 enabled: false, 226 }, 227 }, 228} 229 230cc_binary { 231 name: "fsck.erofs.recovery", 232 defaults: ["fsck.erofs_defaults"], 233 recovery: true, 234 stem: "fsck.erofs", 235} 236