blob: 53ac3e5351cdb6fffb7e7937430f08891d469dcf [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_PATH := $(call my-dir)
2
3## include variants like TA_DEV_KIT_DIR
4## and OPTEE_BIN
5INCLUDE_FOR_BUILD_TA := false
6include $(BUILD_OPTEE_MK)
7INCLUDE_FOR_BUILD_TA :=
8
9VERSION = $(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.
16TA_DEV_KIT_DIR ?= ../invalid_include_path
17
18-include $(TA_DEV_KIT_DIR)/host_include/conf.mk
19
20include $(CLEAR_VARS)
21LOCAL_MODULE := xtest
22LOCAL_SHARED_LIBRARIES := libteec
23
24ifeq ($(CFG_PKCS11_TA),y)
25LOCAL_SHARED_LIBRARIES += libsks
26endif
27
28srcs := regression_1000.c
29
30ifeq ($(CFG_GP_SOCKETS),y)
31srcs += regression_2000.c \
32 sock_server.c \
33 rand_stream.c
34endif
35
36srcs += 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
56ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
57srcs += install_ta.c
58endif
59
60ifeq ($(CFG_SECURE_DATA_PATH),y)
61srcs += sdp_basic.c
62endif
63
64ifeq ($(CFG_PKCS11_TA),y)
65srcs += pkcs11_1000.c
66endif
67
68define 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
74endef
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
81LOCAL_SRC_FILES := $(patsubst %,host/xtest/%,$(srcs))
82
83LOCAL_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)
103LOCAL_CFLAGS += -include conf.h
104LOCAL_CFLAGS += -pthread
105LOCAL_CFLAGS += -g3
106LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-format-zero-length
107
108ifeq ($(CFG_PKCS11_TA),y)
109LOCAL_CFLAGS += -DCFG_PKCS11_TA
110endif
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,
116LOCAL_ADDITIONAL_DEPENDENCIES := $(OPTEE_BIN)
117
118include $(BUILD_EXECUTABLE)
119
120include $(LOCAL_PATH)/ta/Android.mk