blob: b1f289a7bf4f1a4e7c353d0c3f24e6d0dd8e79f8 [file] [log] [blame]
Jerome Forissierf02a2212015-10-29 14:33:35 +01001LOCAL_PATH := $(call my-dir)
2
Yongqin Liu26b8aa82016-06-02 20:54:19 +08003## include variants like TA_DEV_KIT_DIR
Yongqin Liub31d4a92017-11-08 18:47:16 +08004## and OPTEE_BIN
Yongqin Liu26b8aa82016-06-02 20:54:19 +08005INCLUDE_FOR_BUILD_TA := false
6include $(BUILD_OPTEE_MK)
7INCLUDE_FOR_BUILD_TA :=
8
Jerome Forissierf02a2212015-10-29 14:33:35 +01009VERSION = $(shell git describe --always --dirty=-dev 2>/dev/null || echo Unknown)
Jerome Forissierf02a2212015-10-29 14:33:35 +010010
Zoltan Kuscsik88b88c52016-10-20 09:15:56 +020011# 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
Jerome Forissierf02a2212015-10-29 14:33:35 +010018-include $(TA_DEV_KIT_DIR)/host_include/conf.mk
19
20include $(CLEAR_VARS)
21LOCAL_MODULE := xtest
Yongqin Liu286f1fc2018-06-21 22:09:15 +080022LOCAL_VENDOR_MODULE := true
Zoltan Kuscsikd3c5c2c2016-04-08 11:33:39 +020023LOCAL_SHARED_LIBRARIES := libteec
Jerome Forissierf02a2212015-10-29 14:33:35 +010024
Yongqin Liu286f1fc2018-06-21 22:09:15 +080025TA_DIR ?= /vendor/lib/optee_armtz
26
Victor Chong170a1ee2017-04-13 02:13:50 +010027srcs := regression_1000.c
Jens Wiklander02389a92016-12-16 11:13:38 +010028
29ifeq ($(CFG_GP_SOCKETS),y)
Victor Chong170a1ee2017-04-13 02:13:50 +010030srcs += regression_2000.c \
Jens Wiklander02389a92016-12-16 11:13:38 +010031 sock_server.c \
32 rand_stream.c
33endif
34
Victor Chong170a1ee2017-04-13 02:13:50 +010035srcs += adbg/src/adbg_case.c \
Jerome Forissierf02a2212015-10-29 14:33:35 +010036 adbg/src/adbg_enum.c \
37 adbg/src/adbg_expect.c \
38 adbg/src/adbg_log.c \
Jerome Forissierf02a2212015-10-29 14:33:35 +010039 adbg/src/adbg_run.c \
Jerome Forissierf02a2212015-10-29 14:33:35 +010040 adbg/src/security_utils_hex.c \
Igor Opaniuka00eeb12016-09-28 15:57:58 -070041 aes_perf.c \
Victor Chong170a1ee2017-04-13 02:13:50 +010042 benchmark_1000.c \
43 benchmark_2000.c \
44 regression_4000.c \
Jens Wiklanderb4c75aa2018-11-15 10:43:29 +010045 regression_4100.c \
Victor Chong170a1ee2017-04-13 02:13:50 +010046 regression_5000.c \
47 regression_6000.c \
Victor Chong170a1ee2017-04-13 02:13:50 +010048 regression_8000.c \
Jens Wiklander29326472018-04-20 11:22:15 +020049 regression_8100.c \
Victor Chong170a1ee2017-04-13 02:13:50 +010050 sha_perf.c \
Jens Wiklander254a3e32019-01-31 12:25:08 +010051 stats.c \
Victor Chong170a1ee2017-04-13 02:13:50 +010052 xtest_helpers.c \
53 xtest_main.c \
54 xtest_test.c
Jerome Forissierf02a2212015-10-29 14:33:35 +010055
Jens Wiklanderf261a6d2017-11-09 16:45:51 +010056ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
57srcs += install_ta.c
58endif
59
Etienne Carriere41343db2017-03-17 15:38:52 +010060ifeq ($(CFG_SECURE_DATA_PATH),y)
61srcs += sdp_basic.c
62endif
63
Etienne Carriere109c1d72019-01-09 11:02:02 +010064ifeq ($(CFG_PKCS11_TA),y)
65srcs += pkcs11_1000.c
Victor Chongbe1a0422021-01-12 16:49:42 +000066LOCAL_CFLAGS += -DCFG_PKCS11_TA
67LOCAL_SHARED_LIBRARIES += libckteec
Etienne Carriere109c1d72019-01-09 11:02:02 +010068endif
69
Jens Wiklander97d6e292018-04-23 13:00:31 +020070define my-embed-file
71$(TARGET_OUT_HEADERS)/$(1).h: $(LOCAL_PATH)/$(2)
72 @echo ' GEN $$@'
Jens Wiklander950ea1c2018-04-30 15:39:22 +020073 @$(LOCAL_PATH)/scripts/file_to_c.py --inf $$< --out $$@ --name $(1)
Jens Wiklander97d6e292018-04-23 13:00:31 +020074
Yongqin Liu0142c7d2018-10-16 16:22:07 +080075LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_HEADERS)/$(1).h
76
Jens Wiklander97d6e292018-04-23 13:00:31 +020077endef
78
79$(eval $(call my-embed-file,regression_8100_ca_crt,cert/ca.crt))
80$(eval $(call my-embed-file,regression_8100_mid_crt,cert/mid.crt))
81$(eval $(call my-embed-file,regression_8100_my_crt,cert/my.crt))
Jens Wiklander950ea1c2018-04-30 15:39:22 +020082$(eval $(call my-embed-file,regression_8100_my_csr,cert/my.csr))
Jens Wiklander97d6e292018-04-23 13:00:31 +020083
Jerome Forissierf02a2212015-10-29 14:33:35 +010084LOCAL_SRC_FILES := $(patsubst %,host/xtest/%,$(srcs))
85
Zoltan Kuscsikc8186b32016-04-08 11:35:17 +020086LOCAL_C_INCLUDES += $(LOCAL_PATH)/host/xtest \
87 $(LOCAL_PATH)/host/xtest/adbg/include\
Victor Chongbe1a0422021-01-12 16:49:42 +000088 $(LOCAL_PATH)/ta/include \
Zoltan Kuscsikc8186b32016-04-08 11:35:17 +020089 $(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 \
Ovidiu Mihalachi15cecff2019-04-02 16:36:31 +030095 $(LOCAL_PATH)/ta/miss/include \
96 $(LOCAL_PATH)/ta/sims_keepalive/include \
Zoltan Kuscsikc8186b32016-04-08 11:35:17 +020097 $(LOCAL_PATH)/ta/storage_benchmark/include \
Victor Chongbe1a0422021-01-12 16:49:42 +000098 $(LOCAL_PATH)/ta/concurrent/include \
99 $(LOCAL_PATH)/ta/concurrent_large/include \
Igor Opaniuka00eeb12016-09-28 15:57:58 -0700100 $(LOCAL_PATH)/ta/sha_perf/include \
Victor Chong23139a32017-03-01 05:00:54 +0000101 $(LOCAL_PATH)/ta/aes_perf/include \
Etienne Carriere41343db2017-03-17 15:38:52 +0100102 $(LOCAL_PATH)/ta/socket/include \
Javier Almansa Sobrinocddc0002020-02-10 13:35:37 +0000103 $(LOCAL_PATH)/ta/sdp_basic/include \
104 $(LOCAL_PATH)/ta/tpm_log_test/include
Jerome Forissierf02a2212015-10-29 14:33:35 +0100105
Jerome Forissierf9b89252016-08-23 18:30:43 +0200106# Include configuration file generated by OP-TEE OS (CFG_* macros)
Jassi Brar5659bce2018-07-29 12:36:38 +0530107LOCAL_CFLAGS += -I $(TA_DEV_KIT_DIR)/host_include -include conf.h
Jerome Forissierf02a2212015-10-29 14:33:35 +0100108LOCAL_CFLAGS += -pthread
Jerome Forissiera8b78f12016-08-17 09:40:59 +0200109LOCAL_CFLAGS += -g3
Victor Chongea837822018-02-02 14:55:21 +0000110LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-format-zero-length
Jerome Forissierf02a2212015-10-29 14:33:35 +0100111
Yongqin Liu286f1fc2018-06-21 22:09:15 +0800112ifneq ($(TA_DIR),)
113LOCAL_CFLAGS += -DTA_DIR=\"$(TA_DIR)\"
114endif
115
Yongqin Liub31d4a92017-11-08 18:47:16 +0800116## $(OPTEE_BIN) is the path of tee.bin like
117## out/target/product/hikey/optee/arm-plat-hikey/core/tee.bin
118## it will be generated after build the optee_os with target BUILD_OPTEE_OS
119## which is defined in the common ta build mk file included before,
Yongqin Liu0142c7d2018-10-16 16:22:07 +0800120LOCAL_ADDITIONAL_DEPENDENCIES += $(OPTEE_BIN)
Yongqin Liu26b8aa82016-06-02 20:54:19 +0800121
Jerome Forissierf02a2212015-10-29 14:33:35 +0100122include $(BUILD_EXECUTABLE)
Zoltan Kuscsik21758dc2016-04-13 09:41:02 +0200123
124include $(LOCAL_PATH)/ta/Android.mk