• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
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
41cc_defaults {
42    name: "libkmod_cflags_common",
43    local_include_dirs: ["port-gnu"],
44    cflags: [
45        "-include config.h",
46        "-ffunction-sections",
47        "-fdata-sections",
48        "-Wall",
49        "-Werror",
50        "-Wno-format",
51        "-Wno-unused-parameter",
52        "-Wno-unused-variable",
53        "-Dsecure_getenv=getenv",
54        "-DHAVE_CONFIG_H",
55        "-DANOTHER_BRICK_IN_THE",
56        "-DSYSCONFDIR=\"/tmp\"",
57        "-UNDEBUG",
58    ],
59    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",
73        "libkmod/libkmod-builtin.c",
74        "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"],
108}
109