Bob Badour | fbd027c | 2021-02-12 15:05:29 -0800 | [diff] [blame] | 1 | package { |
| 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 |
| 24 | license { |
| 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 Delva | 7c6abf8 | 2019-10-24 16:44:50 -0700 | [diff] [blame] | 41 | cc_defaults { |
| 42 | name: "libkmod_cflags_common", |
Howard Chen | a8830dc | 2017-02-16 14:28:08 +0800 | [diff] [blame] | 43 | local_include_dirs: ["port-gnu"], |
| 44 | cflags: [ |
| 45 | "-include config.h", |
| 46 | "-ffunction-sections", |
| 47 | "-fdata-sections", |
| 48 | "-Wall", |
Chih-Hung Hsieh | 84d0ce6 | 2017-09-28 13:29:55 -0700 | [diff] [blame] | 49 | "-Werror", |
Elliott Hughes | 3548f5a | 2018-10-29 13:51:48 -0700 | [diff] [blame] | 50 | "-Wno-format", |
Howard Chen | a8830dc | 2017-02-16 14:28:08 +0800 | [diff] [blame] | 51 | "-Wno-unused-parameter", |
| 52 | "-Wno-unused-variable", |
| 53 | "-Dsecure_getenv=getenv", |
| 54 | "-DHAVE_CONFIG_H", |
| 55 | "-DANOTHER_BRICK_IN_THE", |
| 56 | "-DSYSCONFDIR=\"/tmp\"", |
Steve Muckle | 2b5f408 | 2019-12-30 16:42:12 -0800 | [diff] [blame] | 57 | "-UNDEBUG", |
Howard Chen | a8830dc | 2017-02-16 14:28:08 +0800 | [diff] [blame] | 58 | ], |
Alistair Delva | 7c6abf8 | 2019-10-24 16:44:50 -0700 | [diff] [blame] | 59 | target: { |
Colin Cross | 0126343 | 2021-09-14 11:04:58 -0700 | [diff] [blame] | 60 | glibc: { |
Alistair Delva | 7c6abf8 | 2019-10-24 16:44:50 -0700 | [diff] [blame] | 61 | cflags: ["-DHAVE_DECL_STRNDUPA"] |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | cc_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 Huang | f9d235a | 2020-10-28 22:24:00 -0700 | [diff] [blame] | 73 | "libkmod/libkmod-builtin.c", |
Alistair Delva | 7c6abf8 | 2019-10-24 16:44:50 -0700 | [diff] [blame] | 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 | |
| 90 | cc_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 Chen | a8830dc | 2017-02-16 14:28:08 +0800 | [diff] [blame] | 108 | } |