1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("./../../../framework/tools/hc-gen/hc_gen.gni") 16 17template("hdf_hcb") { 18 assert(defined(invoker.source), "the source must to be set") 19 assert(defined(invoker.part_name), "the part_name must to be set") 20 21 hc_gen("build_hcs") { 22 sources = [ rebase_path(invoker.source) ] 23 outputs = [ "$target_gen_dir/hdf_default.hcb" ] 24 } 25 26 ohos_prebuilt_etc("$target_name") { 27 deps = [ ":build_hcs" ] 28 hcs_outputs = get_target_outputs(":build_hcs") 29 source = hcs_outputs[0] 30 31 relative_install_dir = "hdfconfig" 32 install_images = [ chipset_base_dir ] 33 34 if (defined(invoker.subsystem_name)) { 35 subsystem_name = invoker.subsystem_name 36 } 37 part_name = invoker.part_name 38 } 39} 40 41template("hdf_cfg") { 42 assert(defined(invoker.source), "the source must to be set") 43 assert(defined(invoker.part_name), "the part_name must to be set") 44 45 hc_gen_start_cfg("gen_start_cfg") { 46 sources = [ rebase_path(invoker.source) ] 47 outputs = [ "$target_gen_dir/hdf_devhost.cfg" ] 48 } 49 50 ohos_prebuilt_etc("$target_name") { 51 deps = [ ":gen_start_cfg" ] 52 outputs = get_target_outputs(":gen_start_cfg") 53 source = outputs[0] 54 relative_install_dir = "init" 55 install_images = [ chipset_base_dir ] 56 if (defined(invoker.subsystem_name)) { 57 subsystem_name = invoker.subsystem_name 58 } 59 part_name = invoker.part_name 60 } 61} 62