1# Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd 2# This file contains confidential and proprietary information of 3# OSWare Technology Co., Ltd 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import("//build/config/clang/clang.gni") 18import("//build/ohos.gni") 19import("//build/ohos/kernel/kernel.gni") 20 21# it needs adaptation for more device target 22target_cpu = "arm64" 23kernel_image = "" 24if (target_cpu == "arm") { 25 kernel_image = "uImage" 26} else if (target_cpu == "arm64") { 27 kernel_image = "Image" 28} 29 30print("imx8mm_group in") 31 32kernel_build_script_dir = "//device/board/osware/imx8mm/kernel" 33kernel_source_dir = "//kernel/linux/$linux_kernel_version" 34 35# //out/ohos-arm64-release 36print("root_build_dir = $root_build_dir") 37 38action("check_build") { 39 script = "check_build.sh" 40 sources = [ kernel_source_dir ] 41 outputs = [ "$root_build_dir/kernel.timestamp" ] 42 args = [ 43 rebase_path(kernel_source_dir, root_build_dir), 44 rebase_path("$root_build_dir/packages/phone/images/$kernel_image"), 45 rebase_path("$root_build_dir/kernel.timestamp"), 46 ] 47} 48 49action("build_kernel") { 50 script = "build_kernel.sh" 51 sources = [ kernel_source_dir ] 52 53 deps = [ ":check_build" ] 54 product_path = "vendor/$product_company/$product_name" 55 build_type = "standard" 56 outputs = [ "$root_build_dir/packages/phone/images/$kernel_image" ] 57 args = [ 58 rebase_path(kernel_build_script_dir, root_build_dir), 59 rebase_path("$root_out_dir/../KERNEL_OBJ"), 60 rebase_path("$root_build_dir/packages/phone/images"), 61 build_type, 62 target_cpu, 63 product_path, 64 device_name, 65 linux_kernel_version, 66 build_variant, 67 device_type, 68 ] 69} 70