| # Normally this makefile shouldn't be called directly and we expect the output |
| # path to be on a certain location to fit together with the other OP-TEE |
| # gits and helper scripts. |
| ifeq ($O,) |
| $(error output path should be specified when calling this makefile) |
| endif |
| |
| include $(TA_DEV_KIT_DIR)/host_include/conf.mk |
| |
| # By default we expect optee_client exported folder to be on a certain relative |
| # path, but if the client specifies the OPTEE_CLIENT_EXPORT then that path will |
| # be used instead. |
| OPTEE_CLIENT_EXPORT ?= ../../../optee_client/out/export |
| |
| CC ?= $(CROSS_COMPILE)gcc |
| CPP ?= $(CROSS_COMPILE)cpp |
| LD ?= $(CROSS_COMPILE)ld |
| AR ?= $(CROSS_COMPILE)ar |
| NM ?= $(CROSS_COMPILE)nm |
| OBJCOPY ?= $(CROSS_COMPILE)objcopy |
| OBJDUMP ?= $(CROSS_COMPILE)objdump |
| READELF ?= $(CROSS_COMPILE)readelf |
| |
| ifdef CFG_GP_PACKAGE_PATH |
| GP := _gp |
| endif |
| |
| srcs := xtest_1000.c \ |
| xtest_4000.c \ |
| xtest_5000.c \ |
| xtest_6000.c \ |
| xtest_7000$(GP).c \ |
| xtest_10000.c \ |
| xtest_20000.c \ |
| xtest_benchmark_1000.c \ |
| xtest_benchmark_2000.c \ |
| xtest_helpers.c \ |
| xtest_main.c \ |
| xtest_test.c \ |
| sha_perf.c \ |
| aes_perf.c \ |
| adbg/src/adbg_case.c \ |
| adbg/src/adbg_enum.c \ |
| adbg/src/adbg_expect.c \ |
| adbg/src/adbg_log.c \ |
| adbg/src/adbg_run.c \ |
| adbg/src/security_utils_hex.c |
| |
| ifdef CFG_GP_PACKAGE_PATH |
| CFLAGS += -DWITH_GP_TESTS |
| |
| srcs += xtest_7500.c \ |
| xtest_8000.c \ |
| xtest_8500.c \ |
| xtest_9000.c |
| endif |
| |
| objs := $(patsubst %.c,$(O)/%.o, $(srcs)) |
| |
| CFLAGS += -I./ |
| CFLAGS += -I./adbg/include |
| CFLAGS += -I./xml/include |
| |
| CFLAGS += -I$(OPTEE_CLIENT_EXPORT)/include |
| CFLAGS += -I$(TA_DEV_KIT_DIR)/host_include |
| |
| CFLAGS += -I../../ta/create_fail_test/include |
| CFLAGS += -I../../ta/crypt/include |
| CFLAGS += -I../../ta/enc_fs/include |
| CFLAGS += -I../../ta/os_test/include |
| CFLAGS += -I../../ta/rpc_test/include |
| CFLAGS += -I../../ta/sims/include |
| CFLAGS += -I../../ta/storage/include |
| CFLAGS += -I../../ta/storage_benchmark/include |
| CFLAGS += -I../../ta/concurrent/include |
| CFLAGS += -I../../ta/concurrent_large/include |
| CFLAGS += -I../../ta/sha_perf/include |
| CFLAGS += -I../../ta/aes_perf/include |
| ifdef CFG_GP_PACKAGE_PATH |
| CFLAGS += -I../../ta/GP_TTA_Arithmetical |
| CFLAGS += -I../../ta/GP_TTA_Crypto |
| CFLAGS += -I../../ta/GP_TTA_DS |
| CFLAGS += -I../../ta/GP_TTA_TCF |
| CFLAGS += -I../../ta/GP_TTA_TCF_ICA |
| CFLAGS += -I../../ta/GP_TTA_TCF_ICA2 |
| CFLAGS += -I../../ta/GP_TTA_TCF_MultipleInstanceTA |
| CFLAGS += -I../../ta/GP_TTA_TCF_SingleInstanceTA |
| CFLAGS += -I../../ta/GP_TTA_Time |
| CFLAGS += -I../../ta/GP_TTA_answerErrorTo_Invoke |
| CFLAGS += -I../../ta/GP_TTA_answerErrorTo_OpenSession |
| CFLAGS += -I../../ta/GP_TTA_answerSuccessTo_OpenSession_Invoke |
| CFLAGS += -I../../ta/GP_TTA_check_OpenSession_with_4_parameters |
| CFLAGS += -I../../ta/GP_TTA_testingClientAPI |
| |
| # need more include: openssl |
| CFLAGS += -Ifor_gp/include |
| |
| # by default, the client application is compiled as the kernel of optee-os |
| ifeq ($(CFG_ARM32),y) |
| COMPILE_NS_USER ?= 32 |
| else |
| COMPILE_NS_USER ?= 64 |
| endif |
| |
| ifeq ($(COMPILE_NS_USER),32) |
| LDFLAGS += ../lib/armv7/libcrypto.a |
| else |
| LDFLAGS += ../lib/armv8/libcrypto.a |
| endif |
| |
| endif |
| |
| # Include configuration file generated by OP-TEE OS (CFG_* macros) |
| CFLAGS += -include conf.h |
| |
| ifndef CFG_GP_PACKAGE_PATH |
| CFLAGS += -Wall -Wcast-align -Werror \ |
| -Werror-implicit-function-declaration -Wextra -Wfloat-equal \ |
| -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \ |
| -Wmissing-declarations -Wmissing-format-attribute \ |
| -Wmissing-include-dirs -Wmissing-noreturn \ |
| -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ |
| -Wshadow -Wstrict-prototypes -Wswitch-default \ |
| -Wwrite-strings \ |
| -Wno-missing-field-initializers -Wno-format-zero-length |
| endif |
| |
| CFLAGS += -g3 |
| |
| LDFLAGS += -L$(OPTEE_CLIENT_EXPORT)/lib -lteec |
| LDFLAGS += -lpthread -lm |
| |
| .PHONY: all |
| all: xtest |
| |
| xtest: $(objs) |
| @echo " LD $(O)/$@" |
| $(q)@$(CC) -o $(O)/$@ $+ $(LDFLAGS) |
| |
| $(O)/%.o: $(CURDIR)/%.c |
| $(q)mkdir -p $(O)/adbg/src |
| @echo ' CC $<' |
| $(q)$(CC) $(CFLAGS) -c $< -o $@ |
| |
| .PHONY: clean |
| clean: |
| @echo ' CLEAN $(O)' |
| $(q)rm -f $(O)/xtest |
| $(q)$(foreach obj,$(objs), rm -f $(obj)) |