1# Copyright (C) 2024 Huawei Technologies Co., Ltd. 2# Licensed under the Mulan PSL v2. 3# You can use this software according to the terms and conditions of the Mulan 4# PSL v2. 5# You may obtain a copy of Mulan PSL v2 at: 6# http://license.coscl.org.cn/MulanPSL2 7# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY 8# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 9# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 10# See the Mulan PSL v2 for more details. 11import("//build/ohos.gni") 12import("//build/ohos/ndk/ndk.gni") 13 14copy("tee_ndk_make") { 15 sources = [ 16 "./mk/common.mk", 17 "./mk/common_flags.mk", 18 "./mk/common_llvm.mk", 19 ] 20 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/mk/{{source_file_part}}" ] 21} 22 23copy("tee_ndk_cmake") { 24 sources = [ 25 "./cmake/aarch64_toolchain.cmake", 26 "./cmake/arm_toolchain.cmake", 27 "./cmake/common.cmake", 28 "./cmake/common_flags.cmake", 29 "./cmake/llvm_toolchain.cmake", 30 ] 31 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/cmake/{{source_file_part}}" ] 32} 33 34copy("tee_ndk_config") { 35 sources = [ 36 "config/config_ta_public.ini", 37 "config/ta_sign_algo_config.ini", 38 ] 39 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/config/{{source_file_part}}" ] 40} 41 42copy("tee_ndk_script") { 43 sources = [ 44 "./script/dyn_conf_checker.py", 45 "./script/dyn_conf_parser.py", 46 "./script/generate_hash.py", 47 "./script/generate_signature.py", 48 "./script/headers_check.txt", 49 "./script/manifest.py", 50 "./script/manifest_tag_parse_dict.csv", 51 "./script/memctrl_checker.py", 52 "./script/signtool_sec.py", 53 "./script/tag_parse_dict.csv", 54 "./script/ta_check_undefined_symbol.py", 55 "./script/xml_trans_manifest.py", 56 ] 57 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/script/{{source_file_part}}" ] 58} 59 60copy("tee_ndk_ld") { 61 sources = [ 62 "./ld/ta_link.ld", 63 "./ld/ta_link_64.ld", 64 ] 65 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/ld/{{source_file_part}}" ] 66} 67 68copy("tee_ndk_src") { 69 sources = [ 70 "./TA_demo/build_ta.sh", 71 "./TA_demo/CMakeLists.txt", 72 "./TA_demo/configs.xml", 73 "./TA_demo/defconfig", 74 "./TA_demo/Makefile", 75 ] 76 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/TA_demo/{{source_file_part}}" ] 77} 78 79copy("tee_ndk_tools") { 80 sources = [ 81 "./tools/calc_ca_caller_hash.py", 82 "./tools/ca_caller_info.xml", 83 ] 84 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/tools/{{source_file_part}}" ] 85} 86 87copy("tee_ndk_import_shell") { 88 sources = [ 89 "../../thirdparty/open_source/import_open_source_header.sh", 90 ] 91 outputs = [ "$ndk_os_irrelevant_out_dir/build/teekit/thirdparty/open_source/{{source_file_part}}" ] 92} 93 94group("tee_ndk_ta_linux_compile") { 95 deps = [ 96 ":tee_ndk_make", 97 ":tee_ndk_cmake", 98 ":tee_ndk_config", 99 ":tee_ndk_script", 100 ":tee_ndk_ld", 101 ":tee_ndk_src", 102 ":tee_ndk_tools", 103 ":tee_ndk_import_shell", 104 ] 105} 106