Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 1 | # Normally this makefile shouldn't be called directly and we expect the output |
| 2 | # path to be on a certain location to fit together with the other OP-TEE |
| 3 | # gits and helper scripts. |
| 4 | ifeq ($O,) |
| 5 | $(error output path should be specified when calling this makefile) |
| 6 | endif |
| 7 | |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame^] | 8 | include $(TA_DEV_KIT_DIR)/host_include/conf.mk |
| 9 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 10 | # By default we expect optee_client exported folder to be on a certain relative |
| 11 | # path, but if the client specifies the OPTEE_CLIENT_EXPORT then that path will |
| 12 | # be used instead. |
| 13 | OPTEE_CLIENT_EXPORT ?= ../../../optee_client/out/export |
| 14 | |
| 15 | CC := $(CROSS_COMPILE)gcc |
| 16 | CPP := $(CROSS_COMPILE)cpp |
| 17 | LD := $(CROSS_COMPILE)ld |
| 18 | AR := $(CROSS_COMPILE)ar |
| 19 | NM := $(CROSS_COMPILE)nm |
| 20 | OBJCOPY := $(CROSS_COMPILE)objcopy |
| 21 | OBJDUMP := $(CROSS_COMPILE)objdump |
| 22 | READELF := $(CROSS_COMPILE)readelf |
| 23 | |
Jerome Forissier | c6aac93 | 2015-09-24 17:45:08 -0700 | [diff] [blame] | 24 | ifdef CFG_GP_PACKAGE_PATH |
| 25 | GP := _gp |
| 26 | endif |
| 27 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 28 | srcs := xtest_1000.c \ |
| 29 | xtest_4000.c \ |
| 30 | xtest_5000.c \ |
| 31 | xtest_6000.c \ |
Jerome Forissier | c6aac93 | 2015-09-24 17:45:08 -0700 | [diff] [blame] | 32 | xtest_7000$(GP).c \ |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 33 | xtest_10000.c \ |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame^] | 34 | xtest_20000.c \ |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 35 | xtest_helpers.c \ |
| 36 | xtest_main.c \ |
| 37 | xtest_test.c \ |
| 38 | adbg/src/adbg_case.c \ |
| 39 | adbg/src/adbg_enum.c \ |
| 40 | adbg/src/adbg_expect.c \ |
| 41 | adbg/src/adbg_log.c \ |
| 42 | adbg/src/adbg_mts.c \ |
| 43 | adbg/src/adbg_run.c \ |
| 44 | adbg/src/adbg_util.c \ |
| 45 | adbg/src/r_list_genutil.c \ |
| 46 | adbg/src/security_utils_hex.c \ |
| 47 | adbg/src/security_utils_mem.c |
| 48 | |
Jerome Forissier | e368834 | 2015-09-24 10:45:17 -0700 | [diff] [blame] | 49 | ifdef CFG_GP_PACKAGE_PATH |
| 50 | CFLAGS += -DWITH_GP_TESTS |
Pascal Brand | 8a74e36 | 2015-09-10 12:41:52 +0200 | [diff] [blame] | 51 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 52 | srcs += xtest_7500.c \ |
| 53 | xtest_8000.c \ |
| 54 | xtest_8500.c \ |
| 55 | xtest_9000.c |
| 56 | endif |
| 57 | |
| 58 | objs := $(patsubst %.c,$(O)/%.o, $(srcs)) |
| 59 | |
| 60 | CFLAGS += -I./ |
| 61 | CFLAGS += -I./adbg/include |
| 62 | CFLAGS += -I./xml/include |
| 63 | |
| 64 | CFLAGS += -I$(OPTEE_CLIENT_EXPORT)/include |
| 65 | CFLAGS += -I$(TA_DEV_KIT_DIR)/host_include |
| 66 | |
| 67 | CFLAGS += -I../../ta/create_fail_test/include |
| 68 | CFLAGS += -I../../ta/crypt/include |
| 69 | CFLAGS += -I../../ta/enc_fs/include |
| 70 | CFLAGS += -I../../ta/os_test/include |
| 71 | CFLAGS += -I../../ta/rpc_test/include |
| 72 | CFLAGS += -I../../ta/sims/include |
| 73 | CFLAGS += -I../../ta/storage/include |
Jerome Forissier | e368834 | 2015-09-24 10:45:17 -0700 | [diff] [blame] | 74 | ifdef CFG_GP_PACKAGE_PATH |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 75 | CFLAGS += -I../../ta/GP_TTA_Arithmetical |
| 76 | CFLAGS += -I../../ta/GP_TTA_Crypto |
| 77 | CFLAGS += -I../../ta/GP_TTA_DS |
| 78 | CFLAGS += -I../../ta/GP_TTA_TCF |
| 79 | CFLAGS += -I../../ta/GP_TTA_TCF_ICA |
| 80 | CFLAGS += -I../../ta/GP_TTA_TCF_ICA2 |
| 81 | CFLAGS += -I../../ta/GP_TTA_TCF_MultipleInstanceTA |
| 82 | CFLAGS += -I../../ta/GP_TTA_TCF_SingleInstanceTA |
| 83 | CFLAGS += -I../../ta/GP_TTA_Time |
| 84 | CFLAGS += -I../../ta/GP_TTA_answerErrorTo_Invoke |
| 85 | CFLAGS += -I../../ta/GP_TTA_answerErrorTo_OpenSession |
| 86 | CFLAGS += -I../../ta/GP_TTA_answerSuccessTo_OpenSession_Invoke |
| 87 | CFLAGS += -I../../ta/GP_TTA_check_OpenSession_with_4_parameters |
| 88 | CFLAGS += -I../../ta/GP_TTA_testingClientAPI |
| 89 | |
| 90 | # need more include: openssl |
| 91 | CFLAGS += -Ifor_gp/include |
| 92 | |
| 93 | # need more libraries: openssl |
Pascal Brand | fd1596a | 2015-07-10 15:02:17 +0200 | [diff] [blame] | 94 | ifeq ($(CFG_ARM32),y) |
| 95 | LDFLAGS += ../lib/armv7/libcrypto.a |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 96 | else |
Pascal Brand | fd1596a | 2015-07-10 15:02:17 +0200 | [diff] [blame] | 97 | LDFLAGS += ../lib/armv8/libcrypto.a |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 98 | endif |
| 99 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 100 | endif |
| 101 | |
| 102 | # FIXME: Check if and why we need this flag? |
| 103 | CFLAGS += -DUSER_SPACE |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame^] | 104 | ifeq ($(CFG_ENC_FS),y) |
| 105 | CFLAGS += -DCFG_ENC_FS |
| 106 | endif |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 107 | |
Jerome Forissier | e368834 | 2015-09-24 10:45:17 -0700 | [diff] [blame] | 108 | ifndef CFG_GP_PACKAGE_PATH |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 109 | CFLAGS += -Wall -Wcast-align -Werror \ |
| 110 | -Werror-implicit-function-declaration -Wextra -Wfloat-equal \ |
| 111 | -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \ |
| 112 | -Wmissing-declarations -Wmissing-format-attribute \ |
| 113 | -Wmissing-include-dirs -Wmissing-noreturn \ |
| 114 | -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ |
| 115 | -Wshadow -Wstrict-prototypes -Wswitch-default \ |
| 116 | -Wwrite-strings \ |
| 117 | -Wno-missing-field-initializers -Wno-format-zero-length |
| 118 | endif |
| 119 | |
| 120 | LDFLAGS += -L$(OPTEE_CLIENT_EXPORT)/lib -lteec |
| 121 | LDFLAGS += -lpthread |
| 122 | |
| 123 | .PHONY: all |
| 124 | all: xtest |
| 125 | |
| 126 | xtest: $(objs) |
| 127 | @echo " LD $(O)/$@" |
| 128 | $(q)@$(CC) -o $(O)/$@ $+ $(LDFLAGS) |
| 129 | |
| 130 | $(O)/%.o: $(CURDIR)/%.c |
| 131 | $(q)mkdir -p $(O)/adbg/src |
| 132 | @echo ' CC $<' |
| 133 | $(q)$(CC) $(CFLAGS) -c $< -o $@ |
| 134 | |
| 135 | .PHONY: clean |
| 136 | clean: |
| 137 | @echo ' CLEAN $(O)' |
| 138 | $(q)rm -f $(O)/xtest |
| 139 | $(q)$(foreach obj,$(objs), rm -f $(obj)) |