blob: 466f34c5896c23d31da3f3f490eb723144786f6f [file] [log] [blame]
Bob Badourfbd027c2021-02-12 15:05:29 -08001package {
2 default_applicable_licenses: ["external_kmod_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18//
19// large-scale-change included anything that looked like it might be a license
20// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
21//
22// Please consider removing redundant or irrelevant files from 'license_text:'.
23// See: http://go/android-license-faq
24license {
25 name: "external_kmod_license",
26 visibility: [":__subpackages__"],
27 license_kinds: [
28 "SPDX-license-identifier-GPL",
29 "SPDX-license-identifier-GPL-2.0",
30 "SPDX-license-identifier-LGPL",
31 "SPDX-license-identifier-LGPL-2.1",
32 "SPDX-license-identifier-LGPL-3.0",
33 "legacy_unencumbered",
34 ],
35 license_text: [
36 "COPYING",
37 "NOTICE",
38 ],
39}
40
Alistair Delva7c6abf82019-10-24 16:44:50 -070041cc_defaults {
42 name: "libkmod_cflags_common",
Howard Chena8830dc2017-02-16 14:28:08 +080043 local_include_dirs: ["port-gnu"],
44 cflags: [
45 "-include config.h",
46 "-ffunction-sections",
47 "-fdata-sections",
48 "-Wall",
Chih-Hung Hsieh84d0ce62017-09-28 13:29:55 -070049 "-Werror",
Elliott Hughes3548f5a2018-10-29 13:51:48 -070050 "-Wno-format",
Howard Chena8830dc2017-02-16 14:28:08 +080051 "-Wno-unused-parameter",
52 "-Wno-unused-variable",
53 "-Dsecure_getenv=getenv",
54 "-DHAVE_CONFIG_H",
55 "-DANOTHER_BRICK_IN_THE",
56 "-DSYSCONFDIR=\"/tmp\"",
Steve Muckle2b5f4082019-12-30 16:42:12 -080057 "-UNDEBUG",
Howard Chena8830dc2017-02-16 14:28:08 +080058 ],
Alistair Delva7c6abf82019-10-24 16:44:50 -070059 target: {
60 linux_glibc: {
61 cflags: ["-DHAVE_DECL_STRNDUPA"]
62 }
63 }
64}
65
66cc_library_static {
67 defaults: ["libkmod_cflags_common"],
68 export_include_dirs: ["libkmod"],
69 host_supported: true,
70 name: "libkmod",
71 srcs: [
72 "libkmod/libkmod.c",
Haibo Huangf9d235a2020-10-28 22:24:00 -070073 "libkmod/libkmod-builtin.c",
Alistair Delva7c6abf82019-10-24 16:44:50 -070074 "libkmod/libkmod-file.c",
75 "libkmod/libkmod-module.c",
76 "libkmod/libkmod-config.c",
77 "libkmod/libkmod-index.c",
78 "libkmod/libkmod-elf.c",
79 "libkmod/libkmod-list.c",
80 "libkmod/libkmod-signature.c",
81 "shared/array.c",
82 "shared/scratchbuf.c",
83 "shared/util.c",
84 "shared/hash.c",
85 "shared/strbuf.c",
86 ],
87 visibility: ["//external/igt-gpu-tools"],
88}
89
90cc_binary_host {
91 defaults: ["libkmod_cflags_common"],
92 name: "depmod",
93 srcs: [
94 "tools/port.c",
95 "tools/depmod.c",
96 "tools/kmod.c",
97 "tools/modinfo.c",
98 "tools/rmmod.c",
99 "tools/insert.c",
100 "tools/log.c",
101 "tools/modprobe.c",
102 "tools/static-nodes.c",
103 "tools/insmod.c",
104 "tools/lsmod.c",
105 "tools/remove.c",
106 ],
107 static_libs: ["libkmod"],
Howard Chena8830dc2017-02-16 14:28:08 +0800108}