rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | ## include variants like TA_DEV_KIT_DIR |
| 4 | ## and OPTEE_BIN |
| 5 | INCLUDE_FOR_BUILD_TA := false |
| 6 | include $(BUILD_OPTEE_MK) |
| 7 | INCLUDE_FOR_BUILD_TA := |
| 8 | |
| 9 | VERSION = $(shell git describe --always --dirty=-dev 2>/dev/null || echo Unknown) |
| 10 | |
| 11 | # TA_DEV_KIT_DIR must be set to non-empty value to |
| 12 | # avoid the Android build scripts complaining about |
| 13 | # includes pointing outside the Android source tree. |
| 14 | # This var is expected to be set when OPTEE OS built. |
| 15 | # We set the default value to an invalid path. |
| 16 | TA_DEV_KIT_DIR ?= ../invalid_include_path |
| 17 | |
| 18 | -include $(TA_DEV_KIT_DIR)/host_include/conf.mk |
| 19 | |
| 20 | include $(CLEAR_VARS) |
| 21 | LOCAL_MODULE := xtest |
| 22 | LOCAL_SHARED_LIBRARIES := libteec |
| 23 | |
| 24 | ifeq ($(CFG_PKCS11_TA),y) |
| 25 | LOCAL_SHARED_LIBRARIES += libsks |
| 26 | endif |
| 27 | |
| 28 | srcs := regression_1000.c |
| 29 | |
| 30 | ifeq ($(CFG_GP_SOCKETS),y) |
| 31 | srcs += regression_2000.c \ |
| 32 | sock_server.c \ |
| 33 | rand_stream.c |
| 34 | endif |
| 35 | |
| 36 | srcs += adbg/src/adbg_case.c \ |
| 37 | adbg/src/adbg_enum.c \ |
| 38 | adbg/src/adbg_expect.c \ |
| 39 | adbg/src/adbg_log.c \ |
| 40 | adbg/src/adbg_run.c \ |
| 41 | adbg/src/security_utils_hex.c \ |
| 42 | aes_perf.c \ |
| 43 | benchmark_1000.c \ |
| 44 | benchmark_2000.c \ |
| 45 | regression_4000.c \ |
| 46 | regression_5000.c \ |
| 47 | regression_6000.c \ |
| 48 | regression_7000.c \ |
| 49 | regression_8000.c \ |
| 50 | regression_8100.c \ |
| 51 | sha_perf.c \ |
| 52 | xtest_helpers.c \ |
| 53 | xtest_main.c \ |
| 54 | xtest_test.c |
| 55 | |
| 56 | ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y) |
| 57 | srcs += install_ta.c |
| 58 | endif |
| 59 | |
| 60 | ifeq ($(CFG_SECURE_DATA_PATH),y) |
| 61 | srcs += sdp_basic.c |
| 62 | endif |
| 63 | |
| 64 | ifeq ($(CFG_PKCS11_TA),y) |
| 65 | srcs += pkcs11_1000.c |
| 66 | endif |
| 67 | |
| 68 | define my-embed-file |
| 69 | $(TARGET_OUT_HEADERS)/$(1).h: $(LOCAL_PATH)/$(2) |
| 70 | @echo ' GEN $$@' |
| 71 | @$(LOCAL_PATH)/scripts/file_to_c.py --inf $$< --out $$@ --name $(1) |
| 72 | |
| 73 | $(LOCAL_PATH)/host/xtest/regression_8100.c: $(TARGET_OUT_HEADERS)/$(1).h |
| 74 | endef |
| 75 | |
| 76 | $(eval $(call my-embed-file,regression_8100_ca_crt,cert/ca.crt)) |
| 77 | $(eval $(call my-embed-file,regression_8100_mid_crt,cert/mid.crt)) |
| 78 | $(eval $(call my-embed-file,regression_8100_my_crt,cert/my.crt)) |
| 79 | $(eval $(call my-embed-file,regression_8100_my_csr,cert/my.csr)) |
| 80 | |
| 81 | LOCAL_SRC_FILES := $(patsubst %,host/xtest/%,$(srcs)) |
| 82 | |
| 83 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/host/xtest \ |
| 84 | $(LOCAL_PATH)/host/xtest/adbg/include\ |
| 85 | $(LOCAL_PATH)/host/xtest/xml/include \ |
| 86 | $(TA_DEV_KIT_DIR)/host_include \ |
| 87 | $(LOCAL_PATH)/ta/concurrent/include \ |
| 88 | $(LOCAL_PATH)/ta/concurrent_large/include \ |
| 89 | $(LOCAL_PATH)/ta/create_fail_test/include \ |
| 90 | $(LOCAL_PATH)/ta/crypt/include \ |
| 91 | $(LOCAL_PATH)/ta/enc_fs/include \ |
| 92 | $(LOCAL_PATH)/ta/os_test/include \ |
| 93 | $(LOCAL_PATH)/ta/rpc_test/include \ |
| 94 | $(LOCAL_PATH)/ta/sims/include \ |
| 95 | $(LOCAL_PATH)/ta/include \ |
| 96 | $(LOCAL_PATH)/ta/storage_benchmark/include \ |
| 97 | $(LOCAL_PATH)/ta/sha_perf/include \ |
| 98 | $(LOCAL_PATH)/ta/aes_perf/include \ |
| 99 | $(LOCAL_PATH)/ta/socket/include \ |
| 100 | $(LOCAL_PATH)/ta/sdp_basic/include |
| 101 | |
| 102 | # Include configuration file generated by OP-TEE OS (CFG_* macros) |
| 103 | LOCAL_CFLAGS += -include conf.h |
| 104 | LOCAL_CFLAGS += -pthread |
| 105 | LOCAL_CFLAGS += -g3 |
| 106 | LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-format-zero-length |
| 107 | |
| 108 | ifeq ($(CFG_PKCS11_TA),y) |
| 109 | LOCAL_CFLAGS += -DCFG_PKCS11_TA |
| 110 | endif |
| 111 | |
| 112 | ## $(OPTEE_BIN) is the path of tee.bin like |
| 113 | ## out/target/product/hikey/optee/arm-plat-hikey/core/tee.bin |
| 114 | ## it will be generated after build the optee_os with target BUILD_OPTEE_OS |
| 115 | ## which is defined in the common ta build mk file included before, |
| 116 | LOCAL_ADDITIONAL_DEPENDENCIES := $(OPTEE_BIN) |
| 117 | |
| 118 | include $(BUILD_EXECUTABLE) |
| 119 | |
| 120 | include $(LOCAL_PATH)/ta/Android.mk |