Gao Xiang | a545e53 | 2020-06-17 10:57:19 +0800 | [diff] [blame] | 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 | |
Bob Badour | 22e33da | 2021-02-12 17:30:51 -0800 | [diff] [blame] | 16 | package { |
| 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 |
| 34 | license { |
| 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 | |
Elliott Hughes | 7269cd8 | 2021-05-11 09:52:24 -0700 | [diff] [blame] | 47 | genrule { |
| 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 | |
Gao Xiang | a545e53 | 2020-06-17 10:57:19 +0800 | [diff] [blame] | 54 | cc_defaults { |
| 55 | name: "erofs-utils_defaults", |
| 56 | |
| 57 | cflags: [ |
| 58 | "-Wall", |
| 59 | "-Werror", |
| 60 | "-Wno-ignored-qualifiers", |
| 61 | "-Wno-pointer-arith", |
| 62 | "-Wno-unused-parameter", |
Elliott Hughes | 7269cd8 | 2021-05-11 09:52:24 -0700 | [diff] [blame] | 63 | "-include erofs-utils-version.h", |
Gao Xiang | a545e53 | 2020-06-17 10:57:19 +0800 | [diff] [blame] | 64 | "-DHAVE_FALLOCATE", |
| 65 | "-DHAVE_LINUX_TYPES_H", |
| 66 | "-DHAVE_LIBSELINUX", |
| 67 | "-DHAVE_LIBUUID", |
| 68 | "-DLZ4_ENABLED", |
| 69 | "-DLZ4HC_ENABLED", |
| 70 | "-DWITH_ANDROID", |
| 71 | ], |
| 72 | local_include_dirs: [ |
| 73 | "include", |
| 74 | ], |
| 75 | include_dirs: [ |
| 76 | "external/e2fsprogs/lib/", |
| 77 | ], |
Elliott Hughes | 7269cd8 | 2021-05-11 09:52:24 -0700 | [diff] [blame] | 78 | generated_headers: ["erofs-utils-version.h"], |
Gao Xiang | a545e53 | 2020-06-17 10:57:19 +0800 | [diff] [blame] | 79 | shared_libs: [ |
| 80 | "libcutils", |
| 81 | "libext2_uuid", |
| 82 | "libselinux", |
| 83 | ], |
| 84 | static_libs: [ |
| 85 | "liblz4", |
| 86 | ], |
| 87 | } |
| 88 | |
| 89 | cc_binary_host { |
| 90 | name: "mkfs.erofs", |
| 91 | |
| 92 | defaults: ["erofs-utils_defaults"], |
| 93 | |
| 94 | srcs: [ |
| 95 | "lib/*.c", |
| 96 | "mkfs/*.c", |
| 97 | ], |
Alistair Delva | e5df3f5 | 2020-11-02 10:39:22 -0800 | [diff] [blame] | 98 | |
| 99 | target: { |
| 100 | darwin: { |
| 101 | enabled: false, |
| 102 | }, |
| 103 | }, |
Gao Xiang | a545e53 | 2020-06-17 10:57:19 +0800 | [diff] [blame] | 104 | } |
| 105 | |
Gao Xiang | 37d9f37 | 2020-06-17 13:39:39 +0800 | [diff] [blame] | 106 | sh_binary_host { |
| 107 | name: "mkerofsimage.sh", |
| 108 | src: "mkerofsimage.sh", |
| 109 | required: [ |
| 110 | "img2simg", |
| 111 | "mkfs.erofs", |
| 112 | ], |
Gao Xiang | 37d9f37 | 2020-06-17 13:39:39 +0800 | [diff] [blame] | 113 | |
Alistair Delva | e5df3f5 | 2020-11-02 10:39:22 -0800 | [diff] [blame] | 114 | target: { |
| 115 | darwin: { |
| 116 | enabled: false, |
| 117 | }, |
| 118 | }, |
| 119 | } |