Matthias Maennich | 3334b77 | 2021-06-21 12:54:56 +0100 | [diff] [blame^] | 1 | # Copyright (C) 2021 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | load("//build/kleaf:kernel.bzl", "kernel_build") |
| 16 | |
| 17 | filegroup( |
| 18 | name = "build_configs", |
| 19 | srcs = glob(["build.config.*"]), |
| 20 | ) |
| 21 | |
| 22 | filegroup( |
| 23 | name = "sources", |
| 24 | srcs = glob( |
| 25 | ["**"], |
| 26 | exclude = [ |
| 27 | "build.config.*", |
| 28 | "android/*", |
| 29 | "BUILD.bazel", |
| 30 | "**/*.bzl", |
| 31 | ], |
| 32 | ), |
| 33 | ) |
| 34 | |
| 35 | common_outs = [ |
| 36 | "System.map", |
| 37 | "modules.builtin", |
| 38 | "modules.builtin.modinfo", |
| 39 | "vmlinux", |
| 40 | "vmlinux.symvers", |
| 41 | "kernel-headers.tar.gz", |
| 42 | "kernel-uapi-headers.tar.gz", |
| 43 | ] |
| 44 | |
| 45 | aarch64_outs = common_outs + [ |
| 46 | "Image", |
| 47 | "Image.lz4", |
| 48 | ] |
| 49 | |
| 50 | x86_64_outs = common_outs + ["bzImage"] |
| 51 | |
| 52 | [kernel_build( |
| 53 | name = name, |
| 54 | outs = outs, |
| 55 | build_config = config, |
| 56 | build_configs = "//common:build_configs", |
| 57 | sources = "//common:sources", |
| 58 | ) for name, config, outs in [ |
| 59 | ( |
| 60 | "kernel_aarch64", |
| 61 | "common/build.config.gki.aarch64", |
| 62 | aarch64_outs, |
| 63 | ), |
| 64 | ( |
| 65 | "kernel_aarch64_debug", |
| 66 | "common/build.config.gki-debug.aarch64", |
| 67 | aarch64_outs, |
| 68 | ), |
| 69 | ( |
| 70 | "kernel_x86_64", |
| 71 | "common/build.config.gki.x86_64", |
| 72 | x86_64_outs, |
| 73 | ), |
| 74 | ( |
| 75 | "kernel_x86_64_debug", |
| 76 | "common/build.config.gki-debug.x86_64", |
| 77 | x86_64_outs, |
| 78 | ), |
| 79 | ]] |
| 80 | |
| 81 | alias( |
| 82 | name = "kernel", |
| 83 | actual = ":kernel_aarch64", |
| 84 | ) |