| # Copyright (C) 2022 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| # Implementation details. These aren't part of the public API. |
| |
| load("@bazel_skylib//:bzl_library.bzl", "bzl_library") |
| load("@bazel_skylib//rules:common_settings.bzl", "bool_setting", "string_setting") |
| load(":abi/trim_nonlisted_kmi_utils.bzl", "TRIM_NONLISTED_KMI_SETTING_VALUES") |
| |
| bzl_library( |
| name = "impl", |
| srcs = [ |
| "abi/abi_diff.bzl", |
| "abi/abi_dump.bzl", |
| "abi/abi_prop.bzl", |
| "abi/abi_transitions.bzl", |
| "abi/base_kernel_utils.bzl", |
| "abi/extracted_symbols.bzl", |
| "abi/force_add_vmlinux_utils.bzl", |
| "abi/get_src_kmi_symbol_list.bzl", |
| "abi/kernel_build_abi.bzl", |
| "abi/kernel_build_abi_dist.bzl", |
| "abi/trim_nonlisted_kmi_utils.bzl", |
| "btf.bzl", |
| "cache_dir.bzl", |
| "common_providers.bzl", |
| "compile_commands_utils.bzl", |
| "constants.bzl", |
| "ddk/ddk_conditional_filegroup.bzl", |
| "ddk/ddk_headers.bzl", |
| "ddk/ddk_module.bzl", |
| "ddk/ddk_submodule.bzl", |
| "ddk/makefiles.bzl", |
| "debug.bzl", |
| "gki_artifacts.bzl", |
| "image/boot_images.bzl", |
| "image/dtbo.bzl", |
| "image/image_utils.bzl", |
| "image/initramfs.bzl", |
| "image/kernel_images.bzl", |
| "image/system_dlkm_image.bzl", |
| "image/vendor_dlkm_image.bzl", |
| "kernel_build.bzl", |
| "kernel_build_config.bzl", |
| "kernel_build_transition.bzl", |
| "kernel_compile_commands.bzl", |
| "kernel_config.bzl", |
| "kernel_config_settings.bzl", |
| "kernel_config_transition.bzl", |
| "kernel_dtstree.bzl", |
| "kernel_env.bzl", |
| "kernel_filegroup.bzl", |
| "kernel_headers.bzl", |
| "kernel_kythe.bzl", |
| "kernel_module.bzl", |
| "kernel_module_group.bzl", |
| "kernel_modules_install.bzl", |
| "kernel_toolchain_aspect.bzl", |
| "kernel_uapi_headers.bzl", |
| "kernel_uapi_headers_cc_library.bzl", |
| "kernel_unstripped_modules_archive.bzl", |
| "kgdb.bzl", |
| "kmi_symbol_list.bzl", |
| "merged_kernel_uapi_headers.bzl", |
| "modules_prepare.bzl", |
| "modules_prepare_transition.bzl", |
| "out_headers_allowlist_archive.bzl", |
| "raw_kmi_symbol_list.bzl", |
| "scripts_config_arg_builder.bzl", |
| "srcs_aspect.bzl", |
| "stamp.bzl", |
| "status.bzl", |
| "utils.bzl", |
| ], |
| visibility = ["//build/kernel/kleaf:__subpackages__"], |
| deps = [ |
| "//build/kernel/kleaf:directory_with_structure_def", |
| "//build/kernel/kleaf:hermetic_tools_def", |
| "//build/kernel/kleaf:update_source_file_def", |
| "@bazel_skylib//lib:collections", |
| "@bazel_skylib//lib:paths", |
| "@bazel_skylib//lib:sets", |
| "@bazel_skylib//lib:shell", |
| "@bazel_skylib//rules:common_settings", |
| ], |
| ) |
| |
| # If true, also pack .cmd files as output. |
| bool_setting( |
| name = "preserve_cmd", |
| build_setting_default = False, |
| # All kernel_* from different packages can see this |
| visibility = ["//visibility:public"], |
| ) |
| |
| # If true, also build compile_commands.json and collect necessary files in $OUT_DIR that |
| # may be used in compile_commands.json (namely generated source files). |
| bool_setting( |
| name = "build_compile_commands", |
| build_setting_default = False, |
| # All kernel_* from different packages can see this |
| visibility = ["//visibility:public"], |
| ) |
| |
| # Whether trimming is actually enabled. |
| # * unknown: the value is unknown. Rules that depends on this setting |
| # must have a transition that sets this properly (possibly based on attrs) |
| # * enabled: trimming is enabled |
| # * disabled: trimming is disabled |
| # Do not use directly. Use APIs in trim_nonlisted_kmi_utils.bzl instead. |
| string_setting( |
| name = "trim_nonlisted_kmi_setting", |
| build_setting_default = TRIM_NONLISTED_KMI_SETTING_VALUES.unknown, |
| values = [ |
| TRIM_NONLISTED_KMI_SETTING_VALUES.unknown, |
| TRIM_NONLISTED_KMI_SETTING_VALUES.enabled, |
| TRIM_NONLISTED_KMI_SETTING_VALUES.disabled, |
| ], |
| # All kernel_* from different packages can see this |
| visibility = ["//visibility:public"], |
| ) |
| |
| # Forcefully add vmlinux to outs (implicitly) and to MAKE_GOALS. |
| bool_setting( |
| name = "force_add_vmlinux", |
| build_setting_default = False, |
| # All kernel_* from different packages can see this |
| visibility = ["//visibility:public"], |
| ) |
| |
| # Forcefully ignore base_kernel. |
| bool_setting( |
| name = "force_ignore_base_kernel", |
| build_setting_default = False, |
| # All kernel_* from different packages can see this |
| visibility = ["//visibility:public"], |
| ) |
| |
| py_binary( |
| name = "ddk/gen_makefiles", |
| srcs = ["ddk/gen_makefiles.py"], |
| visibility = ["//visibility:public"], |
| deps = [ |
| "@io_abseil_py//absl/flags:argparse_flags", |
| ], |
| ) |
| |
| py_binary( |
| name = "kernel_kythe_reconstruct_out_dir", |
| srcs = ["kernel_kythe_reconstruct_out_dir.py"], |
| visibility = ["//visibility:public"], |
| ) |
| |
| py_binary( |
| name = "print_gcno_mapping", |
| srcs = ["print_gcno_mapping.py"], |
| visibility = ["//visibility:public"], |
| ) |