• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-ignored-qualifiers",
61        "-Wno-pointer-arith",
62        "-Wno-unused-parameter",
63        "-Wno-unused-function",
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}
73
74cc_defaults {
75    name: "erofs-utils_defaults",
76    defaults: ["erofs-utils_export_defaults"],
77
78    cflags: [
79        "-include erofs-utils-version.h",
80    ],
81    local_include_dirs: [
82        "include",
83    ],
84    include_dirs: [
85        "external/e2fsprogs/lib/",
86    ],
87    generated_headers: ["erofs-utils-version.h"],
88    static_libs: [
89        "libbase",
90        "libcutils",
91        "libext2_uuid",
92        "liblog",
93        "liblz4",
94        "libselinux",
95    ],
96}
97
98cc_library {
99    host_supported: true,
100    recovery_available: true,
101    name: "liberofs",
102    defaults: ["erofs-utils_defaults"],
103    srcs: [
104        "lib/*.c",
105    ],
106    export_include_dirs: ["include"],
107
108    target: {
109        darwin: {
110            enabled: false,
111        },
112    },
113}
114
115cc_defaults {
116    name: "mkfs-erofs_defaults",
117
118    defaults: ["erofs-utils_defaults"],
119
120    srcs: [
121        "lib/*.c",
122        "mkfs/*.c",
123    ],
124    static_libs: [
125        "liberofs",
126    ],
127
128    target: {
129        darwin: {
130            enabled: false,
131        },
132    },
133}
134
135cc_binary {
136    name: "mkfs.erofs",
137
138    defaults: ["mkfs-erofs_defaults"],
139    host_supported: true,
140    recovery_available: true,
141}
142
143cc_binary_host {
144    name: "make_erofs",
145
146    defaults: ["mkfs-erofs_defaults"],
147}
148
149cc_binary {
150    name: "dump.erofs",
151    defaults: ["erofs-utils_defaults"],
152    host_supported: true,
153    recovery_available: true,
154    srcs: [
155        "lib/*.c",
156        "dump/*.c",
157    ],
158    static_libs: [
159        "liberofs",
160    ],
161    target: {
162        darwin: {
163            enabled: false,
164        },
165    },
166}
167
168cc_binary {
169    name: "fsck.erofs",
170    defaults: ["erofs-utils_defaults"],
171    host_supported: true,
172    recovery_available: true,
173    srcs: [
174        "lib/*.c",
175        "fsck/*.c",
176    ],
177    static_libs: [
178        "liberofs",
179    ],
180    target: {
181        darwin: {
182            enabled: false,
183        },
184    },
185}
186