1 Star 0 Fork 102

fanjianchen/kernel_linux_build_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.gn 2.59 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) 2021 Huawei Device Co., Ltd.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if (os_level == "mini" || os_level == "small") {
import("//build/lite/config/component/lite_component.gni")
} else {
import("//build/config/clang/clang.gni")
import("//build/ohos.gni")
}
import("//build/ohos/kernel/kernel.gni")
# it needs adaptation for more device target
kernel_image = ""
if (target_cpu == "arm") {
kernel_image = "uImage"
} else if (target_cpu == "arm64") {
kernel_image = "Image"
}
if (os_level == "mini" || os_level == "small") {
build_ext_component("linux_kernel") {
no_default_deps = true
exec_path = rebase_path(".", root_build_dir)
outdir = rebase_path("$root_out_dir")
build_type = "small"
product_path_rebase = rebase_path(product_path, ohos_root_path)
command = "./kernel_module_build.sh ${outdir} ${build_type} ${target_cpu} ${product_path_rebase} ${board_name} ${linux_kernel_version}"
}
} else {
kernel_build_script_dir = "//kernel/linux/build"
kernel_source_dir = "//kernel/linux/$linux_kernel_version"
action("check_build") {
script = "check_build.sh"
sources = [ kernel_source_dir ]
outputs = [ "$root_build_dir/kernel.timestamp" ]
args = [
rebase_path(kernel_source_dir, root_build_dir),
rebase_path("$root_build_dir/packages/phone/images/$kernel_image"),
rebase_path("$root_build_dir/kernel.timestamp"),
]
}
action("build_kernel") {
script = "build_kernel.sh"
sources = [ kernel_source_dir ]
deps = [ ":check_build" ]
product_path = "vendor/$product_company/$product_name"
build_type = "standard"
outputs = [ "$root_build_dir/packages/phone/images/$kernel_image" ]
args = [
rebase_path(kernel_build_script_dir, root_build_dir),
rebase_path("$root_out_dir/../KERNEL_OBJ"),
rebase_path("$root_build_dir/packages/phone/images"),
build_type,
target_cpu,
product_path,
device_name,
linux_kernel_version,
]
}
group("linux_kernel") {
deps = [ ":build_kernel" ]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/super_demon/kernel_linux_build_1.git
git@gitee.com:super_demon/kernel_linux_build_1.git
super_demon
kernel_linux_build_1
kernel_linux_build_1
master

搜索帮助