forked from OP-TEE/optee_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Android.mk
107 lines (80 loc) · 3.64 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
################################################################################
# Android optee-client, libckteec and optee-supplicant makefile #
################################################################################
LOCAL_PATH := $(call my-dir)
# 3 (debug) is too noisy
CFG_TEE_CLIENT_LOG_LEVEL ?= 2
CFG_TEE_SUPP_LOG_LEVEL ?= 2
# Define Android-specific configuration before including config.mk
CFG_TEE_CLIENT_LOAD_PATH ?= /vendor/lib
TEEC_TEST_LOAD_PATH ?= /data/vendor/tee
CFG_TEE_FS_PARENT_PATH ?= /data/vendor/tee
CFG_TEE_SUPP_PLUGINS ?= y
ifneq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),)
CFG_TEE_PLUGIN_LOAD_PATH ?= /vendor/lib64/tee-supplicant/plugins/
else
CFG_TEE_PLUGIN_LOAD_PATH ?= /vendor/lib/tee-supplicant/plugins/
endif
$(info CFG_TEE_PLUGIN_LOAD_PATH = ${CFG_TEE_PLUGIN_LOAD_PATH})
################################################################################
# Include optee-client common config and flags #
################################################################################
include $(LOCAL_PATH)/config.mk
include $(LOCAL_PATH)/android_flags.mk
optee_CFLAGS = $(CFLAGS)
################################################################################
# Build libteec.so - TEE (Trusted Execution Environment) shared library #
################################################################################
include $(CLEAR_VARS)
LOCAL_CFLAGS += $(optee_CFLAGS)
ifneq ($(CFG_TEE_CLIENT_LOG_FILE),)
LOCAL_CFLAGS += -DTEEC_LOG_FILE=\"$(CFG_TEE_CLIENT_LOG_FILE)\"
endif
LOCAL_CFLAGS += -DDEBUGLEVEL_$(CFG_TEE_CLIENT_LOG_LEVEL)
LOCAL_CFLAGS += -DBINARY_PREFIX=\"TEEC\"
LOCAL_SRC_FILES := libteec/src/tee_client_api.c \
libteec/src/teec_trace.c
ifeq ($(CFG_TEE_BENCHMARK),y)
LOCAL_CFLAGS += -DCFG_TEE_BENCHMARK
LOCAL_SRC_FILES += teec_benchmark.c
endif
LOCAL_C_INCLUDES := $(LOCAL_PATH)/public \
$(LOCAL_PATH)/libteec/include \
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libteec
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
# Build the 32-bit and 64-bit versions.
LOCAL_MULTILIB := both
LOCAL_MODULE_TARGET_ARCH := arm arm64
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/public
include $(BUILD_SHARED_LIBRARY)
################################################################################
# Build libckteec.so #
################################################################################
include $(CLEAR_VARS)
LOCAL_CFLAGS += $(optee_CFLAGS)
LOCAL_SRC_FILES := libckteec/src/pkcs11_api.c \
libckteec/src/ck_debug.c \
libckteec/src/ck_helpers.c \
libckteec/src/invoke_ta.c \
libckteec/src/pkcs11_processing.c \
libckteec/src/pkcs11_token.c \
libckteec/src/serializer.c \
libckteec/src/serialize_ck.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/public \
$(LOCAL_PATH)/libckteec/include
LOCAL_SHARED_LIBRARIES := libteec
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := libckteec
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
# Build the 32-bit and 64-bit versions.
LOCAL_MULTILIB := both
LOCAL_MODULE_TARGET_ARCH := arm arm64
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/libckteec/include
include $(BUILD_SHARED_LIBRARY)
################################################################################
# Build TEE Supplicant #
################################################################################
include $(LOCAL_PATH)/tee-supplicant/tee_supplicant_android.mk