Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 1 | # |
| 2 | # Common definition to all platforms |
| 3 | # |
| 4 | |
Roland Nagy | 206aa46 | 2020-06-24 18:04:45 +0200 | [diff] [blame] | 5 | # Set a variable or error out if it was previously set to a different value |
| 6 | # The reason message (3rd parameter) is optional |
| 7 | # Example: |
| 8 | # $(call force,CFG_FOO,foo,required by CFG_BAR) |
| 9 | define force |
| 10 | $(eval $(call _force,$(1),$(2),$(3))) |
| 11 | endef |
| 12 | |
| 13 | define _force |
| 14 | ifdef $(1) |
| 15 | ifneq ($($(1)),$(2)) |
| 16 | ifneq (,$(3)) |
| 17 | _reason := $$(_empty) [$(3)] |
| 18 | endif |
| 19 | $$(error $(1) is set to '$($(1))' (from $(origin $(1))) but its value must be '$(2)'$$(_reason)) |
| 20 | endif |
| 21 | endif |
| 22 | $(1) := $(2) |
| 23 | endef |
| 24 | |
Jens Wiklander | 650f298 | 2017-04-05 10:08:59 +0200 | [diff] [blame] | 25 | SHELL := bash |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 26 | BASH ?= bash |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 27 | ROOT ?= $(shell pwd)/.. |
| 28 | |
Philip Attfield | 3f9250f | 2016-09-14 07:43:32 +0200 | [diff] [blame] | 29 | BUILD_PATH ?= $(ROOT)/build |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 30 | LINUX_PATH ?= $(ROOT)/linux |
Victor Chong | 9f0d120 | 2016-04-23 16:28:31 +0100 | [diff] [blame] | 31 | OPTEE_GENDRV_MODULE ?= $(LINUX_PATH)/drivers/tee/optee/optee.ko |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 32 | GEN_ROOTFS_PATH ?= $(ROOT)/gen_rootfs |
| 33 | GEN_ROOTFS_FILELIST ?= $(GEN_ROOTFS_PATH)/filelist-tee.txt |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 34 | OPTEE_OS_PATH ?= $(ROOT)/optee_os |
| 35 | OPTEE_CLIENT_PATH ?= $(ROOT)/optee_client |
| 36 | OPTEE_CLIENT_EXPORT ?= $(OPTEE_CLIENT_PATH)/out/export |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 37 | OPTEE_TEST_PATH ?= $(ROOT)/optee_test |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 38 | OPTEE_TEST_OUT_PATH ?= $(ROOT)/optee_test/out |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 39 | OPTEE_EXAMPLES_PATH ?= $(ROOT)/optee_examples |
Etienne Carriere | ef7253c | 2019-05-14 17:16:36 +0200 | [diff] [blame] | 40 | OPTEE_BENCHMARK_PATH ?= $(ROOT)/optee_benchmark |
Jens Wiklander | 88d027c | 2018-05-09 10:12:03 +0200 | [diff] [blame] | 41 | BUILDROOT_TARGET_ROOT ?= $(ROOT)/out-br/target |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 42 | |
Etienne Carriere | cc23f6b | 2016-10-21 10:16:00 +0200 | [diff] [blame] | 43 | # default high verbosity. slow uarts shall specify lower if prefered |
Pascal Brand | 23ef205 | 2016-03-09 15:25:01 +0100 | [diff] [blame] | 44 | CFG_TEE_CORE_LOG_LEVEL ?= 3 |
| 45 | |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 46 | # default disable latency benchmarks (over all OP-TEE layers) |
Igor Opaniuk | 36ff2a3 | 2018-01-04 11:40:10 +0200 | [diff] [blame] | 47 | CFG_TEE_BENCHMARK ?= n |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 48 | |
Jerome Forissier | 1c146e4 | 2020-11-10 17:24:05 +0100 | [diff] [blame] | 49 | # optee_test |
| 50 | WITH_TLS_TESTS ?= y |
Jerome Forissier | 0170c6c | 2020-11-10 17:24:05 +0100 | [diff] [blame] | 51 | ifneq ($(COMPILER),clang) |
| 52 | # assuming GCC toolchain from toolchain.mk |
| 53 | WITH_CXX_TESTS ?= y |
| 54 | endif |
Jerome Forissier | 1c146e4 | 2020-11-10 17:24:05 +0100 | [diff] [blame] | 55 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 56 | CCACHE ?= $(shell which ccache) # Don't remove this comment (space is needed) |
| 57 | |
Roland Nagy | 206aa46 | 2020-06-24 18:04:45 +0200 | [diff] [blame] | 58 | # QEMU shared folders settings |
| 59 | # |
| 60 | # TL;DR: |
| 61 | # 1) make QEMU_VIRTFS_AUTOMOUNT=y run |
| 62 | # will mount the project's root on the host as /mnt/host in QEMU. |
| 63 | # 2) mkdir -p /tmp/qemu-data-tee && make QEMU_PSS_AUTOMOUNT=y run |
| 64 | # will mount the host directory /tmp/qemu-data-tee as /data/tee |
| 65 | # in QEMU, thus creating persistent secure storage. |
| 66 | |
| 67 | ifeq ($(QEMU_VIRTFS_AUTOMOUNT),y) |
| 68 | $(call force,QEMU_VIRTFS_ENABLE,y,required by QEMU_VIRTFS_AUTOMOUNT) |
| 69 | endif |
| 70 | |
| 71 | ifeq ($(QEMU_PSS_AUTOMOUNT),y) |
| 72 | $(call force,QEMU_PSS_ENABLE,y,required by QEMU_PSS_AUTOMOUNT) |
| 73 | endif |
| 74 | |
| 75 | ifeq ($(QEMU_PSS_ENABLE),y) |
| 76 | $(call force,QEMU_VIRTFS_ENABLE,y,required by QEMU_PSS_ENABLE) |
| 77 | endif |
| 78 | |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 79 | # Accessing a shared folder on the host from QEMU: |
| 80 | # # Set QEMU_VIRTFS_ENABLE to 'y' and adjust QEMU_VIRTFS_HOST_DIR |
| 81 | # # Then in QEMU, run: |
| 82 | # # $ mount -t 9p -o trans=virtio host <mount_point> |
Roland Nagy | 206aa46 | 2020-06-24 18:04:45 +0200 | [diff] [blame] | 83 | # # Or enable QEMU_VIRTFS_AUTOMOUNT |
| 84 | QEMU_VIRTFS_ENABLE ?= n |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 85 | QEMU_VIRTFS_HOST_DIR ?= $(ROOT) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 86 | |
Roland Nagy | 206aa46 | 2020-06-24 18:04:45 +0200 | [diff] [blame] | 87 | # Persistent Secure Storage via shared folder |
| 88 | # # Set QEMU_PSS_ENABLE to 'y' and adjust QEMU_PSS_HOST_DIR |
| 89 | # # Then in QEMU, run: |
| 90 | # # $ mount -t 9p -o trans=virtio secure /data/tee |
| 91 | # # Or enable QEMU_PSS_AUTOMOUNT |
| 92 | QEMU_PSS_ENABLE ?= n |
| 93 | QEMU_PSS_HOST_DIR ?= /tmp/qemu-data-tee |
| 94 | |
| 95 | # Warning: when these variables are modified, you must remake the buildroot |
| 96 | # target directory. This can be done without rebuilding everything as follows: |
| 97 | # rm -rf ../out-br/target; find ../out-br/ -name .stamp_target_installed | xargs rm |
| 98 | # make <flags> run |
| 99 | QEMU_VIRTFS_AUTOMOUNT ?= n |
| 100 | QEMU_PSS_AUTOMOUNT ?= n |
| 101 | # Mount point for the shared directory inside QEMU |
| 102 | # Used by the post-build script, this is written to /etc/fstab as the mount |
| 103 | # point of the shared directory |
| 104 | QEMU_VIRTFS_MOUNTPOINT ?= /mnt/host |
| 105 | |
| 106 | # End of QEMU shared folder settings |
| 107 | |
Igor Opaniuk | bbcf27d | 2017-09-13 13:12:51 +0300 | [diff] [blame] | 108 | ################################################################################ |
| 109 | # Mandatory for autotools (for specifying --host) |
| 110 | ################################################################################ |
| 111 | ifeq ($(COMPILE_NS_USER),64) |
| 112 | MULTIARCH := aarch64-linux-gnu |
| 113 | else |
| 114 | MULTIARCH := arm-linux-gnueabihf |
| 115 | endif |
| 116 | |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 117 | ################################################################################ |
| 118 | # Check coherency of compilation mode |
| 119 | ################################################################################ |
| 120 | |
| 121 | ifneq ($(COMPILE_NS_USER),) |
| 122 | ifeq ($(COMPILE_NS_KERNEL),) |
| 123 | $(error COMPILE_NS_KERNEL must be defined as COMPILE_NS_USER=$(COMPILE_NS_USER) is defined) |
| 124 | endif |
| 125 | ifeq (,$(filter $(COMPILE_NS_USER),32 64)) |
| 126 | $(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 or 64) |
| 127 | endif |
| 128 | endif |
| 129 | |
| 130 | ifneq ($(COMPILE_NS_KERNEL),) |
| 131 | ifeq ($(COMPILE_NS_USER),) |
| 132 | $(error COMPILE_NS_USER must be defined as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) is defined) |
| 133 | endif |
| 134 | ifeq (,$(filter $(COMPILE_NS_KERNEL),32 64)) |
| 135 | $(error COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) - Should be 32 or 64) |
| 136 | endif |
| 137 | endif |
| 138 | |
| 139 | ifeq ($(COMPILE_NS_KERNEL),32) |
| 140 | ifneq ($(COMPILE_NS_USER),32) |
| 141 | $(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL)) |
| 142 | endif |
| 143 | endif |
| 144 | |
| 145 | ifneq ($(COMPILE_S_USER),) |
| 146 | ifeq ($(COMPILE_S_KERNEL),) |
| 147 | $(error COMPILE_S_KERNEL must be defined as COMPILE_S_USER=$(COMPILE_S_USER) is defined) |
| 148 | endif |
| 149 | ifeq (,$(filter $(COMPILE_S_USER),32 64)) |
| 150 | $(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 or 64) |
| 151 | endif |
| 152 | endif |
| 153 | |
| 154 | ifneq ($(COMPILE_S_KERNEL),) |
| 155 | OPTEE_OS_COMMON_EXTRA_FLAGS ?= O=out/arm |
| 156 | OPTEE_OS_BIN ?= $(OPTEE_OS_PATH)/out/arm/core/tee.bin |
Jens Wiklander | f7b3509 | 2017-09-01 09:05:32 +0200 | [diff] [blame] | 157 | OPTEE_OS_HEADER_V2_BIN ?= $(OPTEE_OS_PATH)/out/arm/core/tee-header_v2.bin |
| 158 | OPTEE_OS_PAGER_V2_BIN ?= $(OPTEE_OS_PATH)/out/arm/core/tee-pager_v2.bin |
| 159 | OPTEE_OS_PAGEABLE_V2_BIN ?= $(OPTEE_OS_PATH)/out/arm/core/tee-pageable_v2.bin |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 160 | ifeq ($(COMPILE_S_USER),) |
| 161 | $(error COMPILE_S_USER must be defined as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) is defined) |
| 162 | endif |
| 163 | ifeq (,$(filter $(COMPILE_S_KERNEL),32 64)) |
| 164 | $(error COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) - Should be 32 or 64) |
| 165 | endif |
| 166 | endif |
| 167 | |
| 168 | ifeq ($(COMPILE_S_KERNEL),32) |
| 169 | ifneq ($(COMPILE_S_USER),32) |
| 170 | $(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL)) |
| 171 | endif |
| 172 | endif |
| 173 | |
| 174 | |
| 175 | ################################################################################ |
| 176 | # set the compiler when COMPILE_xxx are defined |
| 177 | ################################################################################ |
Jens Wiklander | 92582b5 | 2018-03-14 09:49:29 +0100 | [diff] [blame] | 178 | |
| 179 | |
| 180 | ifeq ($(COMPILE_LEGACY),) |
Pascal Brand | efe5659 | 2016-03-03 10:46:52 +0100 | [diff] [blame] | 181 | CROSS_COMPILE_NS_USER ?= "$(CCACHE)$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)" |
| 182 | CROSS_COMPILE_NS_KERNEL ?= "$(CCACHE)$(AARCH$(COMPILE_NS_KERNEL)_CROSS_COMPILE)" |
| 183 | CROSS_COMPILE_S_USER ?= "$(CCACHE)$(AARCH$(COMPILE_S_USER)_CROSS_COMPILE)" |
| 184 | CROSS_COMPILE_S_KERNEL ?= "$(CCACHE)$(AARCH$(COMPILE_S_KERNEL)_CROSS_COMPILE)" |
Jens Wiklander | 92582b5 | 2018-03-14 09:49:29 +0100 | [diff] [blame] | 185 | else |
| 186 | CROSS_COMPILE_NS_USER ?= "$(CCACHE)$(LEGACY_AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)" |
| 187 | CROSS_COMPILE_NS_KERNEL ?= "$(CCACHE)$(LEGACY_AARCH$(COMPILE_NS_KERNEL)_CROSS_COMPILE)" |
| 188 | CROSS_COMPILE_S_USER ?= "$(CCACHE)$(LEGACY_AARCH$(COMPILE_S_USER)_CROSS_COMPILE)" |
| 189 | CROSS_COMPILE_S_KERNEL ?= "$(CCACHE)$(LEGACY_AARCH$(COMPILE_S_KERNEL)_CROSS_COMPILE)" |
| 190 | endif |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 191 | |
| 192 | ifeq ($(COMPILE_S_USER),32) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 193 | OPTEE_OS_TA_DEV_KIT_DIR ?= $(OPTEE_OS_PATH)/out/arm/export-ta_arm32 |
| 194 | endif |
| 195 | ifeq ($(COMPILE_S_USER),64) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 196 | OPTEE_OS_TA_DEV_KIT_DIR ?= $(OPTEE_OS_PATH)/out/arm/export-ta_arm64 |
| 197 | endif |
| 198 | |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 199 | ifeq ($(COMPILE_S_KERNEL),64) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 200 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_ARM64_core=y |
Jerome Forissier | 6347ed9 | 2020-08-27 14:45:11 +0200 | [diff] [blame] | 201 | else |
| 202 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_ARM64_core=n |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 203 | endif |
| 204 | |
| 205 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 206 | ################################################################################ |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 207 | # defines, macros, configuration etc |
| 208 | ################################################################################ |
| 209 | define KERNEL_VERSION |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 210 | $(shell cd $(LINUX_PATH) && $(MAKE) --no-print-directory kernelversion) |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 211 | endef |
Victor Chong | 3bcef44 | 2017-08-07 10:57:55 +0100 | [diff] [blame] | 212 | |
| 213 | # Read stdin, expand ${VAR} environment variables, output to stdout |
| 214 | # http://superuser.com/a/302847 |
| 215 | define expand-env-var |
| 216 | awk '{while(match($$0,"[$$]{[^}]*}")) {var=substr($$0,RSTART+2,RLENGTH -3);gsub("[$$]{"var"}",ENVIRON[var])}}1' |
| 217 | endef |
| 218 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 219 | DEBUG ?= 0 |
| 220 | |
Jerome Forissier | 7ee482e | 2020-01-07 18:05:55 +0100 | [diff] [blame] | 221 | # Macro to check if a compiler supports a given option |
| 222 | # For example: $(call cc-option,gcc,-Wno-error=stringop-truncation,) |
| 223 | # ...will return -Wno-error=stringop-truncation if gcc supports it, empty |
| 224 | # otherwise. |
| 225 | __cc-option = $(if $(shell $(1) $(2) -c -x c /dev/null -o /dev/null 2>&1 >/dev/null),$(3),$(2)) |
| 226 | _cc-opt-cached-var-name = cached-cc-option$(subst =,~,$(strip $(2)))$(subst $(empty) $(empty),,$(1)) |
| 227 | define _cc-option |
| 228 | $(eval _cached := $(call _cc-opt-cached-var-name,$1,$2)) |
| 229 | $(eval $(_cached) := $(if $(filter $(origin $(_cached)),undefined),$(call __cc-option,$(1),$(2),$(3)),$($(_cached)))) |
| 230 | $($(_cached)) |
| 231 | endef |
| 232 | cc-option = $(strip $(call _cc-option,$(1),$(2),$(3))) |
| 233 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 234 | ################################################################################ |
Pascal Brand | cb45260 | 2015-10-13 10:46:33 +0200 | [diff] [blame] | 235 | # default target is all |
| 236 | ################################################################################ |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 237 | .PHONY: all |
Pascal Brand | cb45260 | 2015-10-13 10:46:33 +0200 | [diff] [blame] | 238 | all: |
| 239 | |
| 240 | ################################################################################ |
Jens Wiklander | 07f2aed | 2018-02-07 13:42:18 +0100 | [diff] [blame] | 241 | # Build root |
| 242 | ################################################################################ |
| 243 | BUILDROOT_ARCH=aarch$(COMPILE_NS_USER) |
Jerome Forissier | 129d3df | 2018-08-21 09:54:43 +0200 | [diff] [blame] | 244 | ifeq ($(GDBSERVER),y) |
| 245 | BUILDROOT_TOOLCHAIN=toolchain-br # Use toolchain supplied by buildroot |
| 246 | DEFCONFIG_GDBSERVER=--br-defconfig build/br-ext/configs/gdbserver.conf |
| 247 | else |
| 248 | # Local toolchains (downloaded by "make toolchains") |
Jens Wiklander | 92582b5 | 2018-03-14 09:49:29 +0100 | [diff] [blame] | 249 | ifeq ($(COMPILE_LEGACY),) |
| 250 | BUILDROOT_TOOLCHAIN=toolchain-aarch$(COMPILE_NS_USER) |
| 251 | else |
| 252 | BUILDROOT_TOOLCHAIN=toolchain-aarch$(COMPILE_NS_USER)-legacy |
| 253 | endif |
Jerome Forissier | 129d3df | 2018-08-21 09:54:43 +0200 | [diff] [blame] | 254 | endif |
Jerome Forissier | 7fbd6ce | 2019-09-03 11:12:45 +0200 | [diff] [blame] | 255 | |
| 256 | BR2_PACKAGE_LIBOPENSSL ?= y |
| 257 | BR2_PACKAGE_MMC_UTILS ?= y |
| 258 | BR2_PACKAGE_OPENSSL ?= y |
Etienne Carriere | e1ece83 | 2019-06-06 11:42:07 +0200 | [diff] [blame] | 259 | BR2_PACKAGE_OPTEE_BENCHMARK_EXT ?= $(CFG_TEE_BENCHMARK) |
| 260 | BR2_PACKAGE_OPTEE_BENCHMARK_EXT_SITE ?= $(BENCHMARK_APP_PATH) |
| 261 | BR2_PACKAGE_OPTEE_CLIENT_EXT_SITE ?= $(OPTEE_CLIENT_PATH) |
| 262 | BR2_PACKAGE_OPTEE_EXAMPLES_EXT ?= y |
| 263 | BR2_PACKAGE_OPTEE_EXAMPLES_EXT_CROSS_COMPILE ?= $(CROSS_COMPILE_S_USER) |
| 264 | BR2_PACKAGE_OPTEE_EXAMPLES_EXT_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR) |
| 265 | BR2_PACKAGE_OPTEE_EXAMPLES_EXT_SITE ?= $(OPTEE_EXAMPLES_PATH) |
Jerome Forissier | 7fbd6ce | 2019-09-03 11:12:45 +0200 | [diff] [blame] | 266 | # The OPTEE_OS package builds nothing, it just installs files into the |
| 267 | # root FS when applicable (for example: shared libraries) |
Etienne Carriere | e1ece83 | 2019-06-06 11:42:07 +0200 | [diff] [blame] | 268 | BR2_PACKAGE_OPTEE_OS_EXT ?= y |
| 269 | BR2_PACKAGE_OPTEE_OS_EXT_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR) |
| 270 | BR2_PACKAGE_OPTEE_OS_EXT_SITE ?= $(CURDIR)/br-ext/package/optee_os_ext |
| 271 | BR2_PACKAGE_OPTEE_TEST_EXT ?= y |
| 272 | BR2_PACKAGE_OPTEE_TEST_EXT_CROSS_COMPILE ?= $(CROSS_COMPILE_S_USER) |
| 273 | BR2_PACKAGE_OPTEE_TEST_EXT_SDK ?= $(OPTEE_OS_TA_DEV_KIT_DIR) |
| 274 | BR2_PACKAGE_OPTEE_TEST_EXT_SITE ?= $(OPTEE_TEST_PATH) |
Jens Wiklander | 68a25e0 | 2020-06-23 15:09:20 +0200 | [diff] [blame] | 275 | BR2_PACKAGE_OPTEE_TEST_EXT_GP_PACKAGE := $(GP_PACKAGE) |
Jerome Forissier | 1c146e4 | 2020-11-10 17:24:05 +0100 | [diff] [blame] | 276 | BR2_PACKAGE_OPTEE_TEST_EXT_WITH_TLS_TESTS := $(WITH_TLS_TESTS) |
Jerome Forissier | 0170c6c | 2020-11-10 17:24:05 +0100 | [diff] [blame] | 277 | BR2_PACKAGE_OPTEE_TEST_EXT_WITH_CXX_TESTS := $(WITH_CXX_TESTS) |
Jerome Forissier | 7fbd6ce | 2019-09-03 11:12:45 +0200 | [diff] [blame] | 278 | BR2_PACKAGE_STRACE ?= y |
| 279 | BR2_TARGET_GENERIC_GETTY_PORT ?= $(if $(CFG_NW_CONSOLE_UART),ttyAMA$(CFG_NW_CONSOLE_UART),ttyAMA0) |
| 280 | |
Etienne Carriere | 487e6e4 | 2019-10-14 20:35:39 +0200 | [diff] [blame] | 281 | # Embed opensc for pkcs11-tool |
| 282 | BR2_PACKAGE_OPENSC ?= y |
| 283 | |
Jerome Forissier | 7fbd6ce | 2019-09-03 11:12:45 +0200 | [diff] [blame] | 284 | # All BR2_* variables from the makefile or the environment are appended to |
| 285 | # ../out-br/extra.conf. All values are quoted "..." except y and n. |
| 286 | double-quote = "#" # This really sets the variable to " and avoids upsetting vim's syntax highlighting |
| 287 | streq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) |
| 288 | y-or-n = $(or $(call streq,y,$(1)),$(call streq,n,$(1))) |
| 289 | append-var_ = echo '$(1)=$(3)'$($(1))'$(3)' >>$(2); |
| 290 | append-var = $(call append-var_,$(1),$(2),$(if $(call y-or-n,$($(1))),,$(double-quote))) |
| 291 | append-br2-vars = $(foreach var,$(filter BR2_%,$(.VARIABLES)),$(call append-var,$(var),$(1))) |
| 292 | |
Jens Wiklander | 07f2aed | 2018-02-07 13:42:18 +0100 | [diff] [blame] | 293 | .PHONY: buildroot |
| 294 | buildroot: optee-os |
| 295 | @mkdir -p ../out-br |
| 296 | @rm -f ../out-br/build/optee_*/.stamp_* |
| 297 | @rm -f ../out-br/extra.conf |
Jerome Forissier | 7fbd6ce | 2019-09-03 11:12:45 +0200 | [diff] [blame] | 298 | @$(call append-br2-vars,../out-br/extra.conf) |
Jens Wiklander | 07f2aed | 2018-02-07 13:42:18 +0100 | [diff] [blame] | 299 | @(cd .. && python build/br-ext/scripts/make_def_config.py \ |
| 300 | --br buildroot --out out-br --br-ext build/br-ext \ |
| 301 | --top-dir "$(ROOT)" \ |
| 302 | --br-defconfig build/br-ext/configs/optee_$(BUILDROOT_ARCH) \ |
| 303 | --br-defconfig build/br-ext/configs/optee_generic \ |
Jens Wiklander | 92582b5 | 2018-03-14 09:49:29 +0100 | [diff] [blame] | 304 | --br-defconfig build/br-ext/configs/$(BUILDROOT_TOOLCHAIN) \ |
Jerome Forissier | 129d3df | 2018-08-21 09:54:43 +0200 | [diff] [blame] | 305 | $(DEFCONFIG_GDBSERVER) \ |
Jens Wiklander | 07f2aed | 2018-02-07 13:42:18 +0100 | [diff] [blame] | 306 | --br-defconfig out-br/extra.conf \ |
| 307 | --make-cmd $(MAKE)) |
| 308 | @$(MAKE) -C ../out-br all |
| 309 | |
| 310 | .PHONY: buildroot-clean |
| 311 | buildroot-clean: |
| 312 | @test ! -d $(ROOT)/out-br || $(MAKE) -C $(ROOT)/out-br clean |
| 313 | |
| 314 | .PHONY: buildroot-cleaner |
| 315 | buildroot-cleaner: |
| 316 | @rm -rf $(ROOT)/out-br |
| 317 | |
| 318 | ################################################################################ |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 319 | # Linux |
| 320 | ################################################################################ |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 321 | ifeq ($(CFG_TEE_BENCHMARK),y) |
| 322 | LINUX_DEFCONFIG_BENCH ?= $(CURDIR)/kconfigs/tee_bench.conf |
| 323 | endif |
| 324 | |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 325 | LINUX_COMMON_FLAGS ?= LOCALVERSION= CROSS_COMPILE=$(CROSS_COMPILE_NS_KERNEL) |
| 326 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 327 | .PHONY: linux-common |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 328 | linux-common: linux-defconfig |
| 329 | $(MAKE) -C $(LINUX_PATH) $(LINUX_COMMON_FLAGS) |
| 330 | |
Jerome Forissier | e100238 | 2015-11-26 11:36:00 +0100 | [diff] [blame] | 331 | $(LINUX_PATH)/.config: $(LINUX_DEFCONFIG_COMMON_FILES) |
| 332 | cd $(LINUX_PATH) && \ |
| 333 | ARCH=$(LINUX_DEFCONFIG_COMMON_ARCH) \ |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 334 | scripts/kconfig/merge_config.sh $(LINUX_DEFCONFIG_COMMON_FILES) \ |
| 335 | $(LINUX_DEFCONFIG_BENCH) |
Jerome Forissier | e100238 | 2015-11-26 11:36:00 +0100 | [diff] [blame] | 336 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 337 | .PHONY: linux-defconfig-clean-common |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 338 | linux-defconfig-clean-common: |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 339 | rm -f $(LINUX_PATH)/.config |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 340 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 341 | # LINUX_CLEAN_COMMON_FLAGS should be defined in specific makefiles (hikey.mk,...) |
| 342 | .PHONY: linux-clean-common |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 343 | linux-clean-common: linux-defconfig-clean |
| 344 | $(MAKE) -C $(LINUX_PATH) $(LINUX_CLEAN_COMMON_FLAGS) clean |
| 345 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 346 | # LINUX_CLEANER_COMMON_FLAGS should be defined in specific makefiles (hikey.mk,...) |
| 347 | .PHONY: linux-cleaner-common |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 348 | linux-cleaner-common: linux-defconfig-clean |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 349 | $(MAKE) -C $(LINUX_PATH) $(LINUX_CLEANER_COMMON_FLAGS) distclean |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 350 | |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 351 | ################################################################################ |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 352 | # EDK2 / Tianocore |
| 353 | ################################################################################ |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 354 | .PHONY: edk2-common |
Joakim Bech | ab62261 | 2017-11-15 10:45:28 +0100 | [diff] [blame] | 355 | edk2-common: |
Joakim Bech | c94e95a | 2017-11-25 11:06:50 +0100 | [diff] [blame] | 356 | $(call edk2-env) && \ |
| 357 | export PACKAGES_PATH=$(EDK2_PATH):$(EDK2_PLATFORMS_PATH) && \ |
Joakim Bech | ab62261 | 2017-11-15 10:45:28 +0100 | [diff] [blame] | 358 | source $(EDK2_PATH)/edksetup.sh && \ |
| 359 | $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools && \ |
| 360 | $(call edk2-call) all |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 361 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 362 | .PHONY: edk2-clean-common |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 363 | edk2-clean-common: |
Joakim Bech | c94e95a | 2017-11-25 11:06:50 +0100 | [diff] [blame] | 364 | $(call edk2-env) && \ |
Joakim Bech | ab62261 | 2017-11-15 10:45:28 +0100 | [diff] [blame] | 365 | export PACKAGES_PATH=$(EDK2_PATH):$(ROOT)/edk2-platforms && \ |
| 366 | source $(EDK2_PATH)/edksetup.sh && \ |
| 367 | $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools clean && \ |
| 368 | $(call edk2-call) cleanall |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 369 | |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 370 | ################################################################################ |
| 371 | # QEMU / QEMUv8 |
| 372 | ################################################################################ |
Jerome Forissier | 1dace42 | 2021-02-01 09:16:22 +0100 | [diff] [blame^] | 373 | QEMU_CONFIGURE_PARAMS_COMMON = --cc="$(CCACHE)gcc" --extra-cflags="-Wno-error" \ |
| 374 | --disable-docs |
Albert Schwarzkopf | d6b1781 | 2019-12-22 23:40:59 +0100 | [diff] [blame] | 375 | QEMU_EXTRA_ARGS +=\ |
| 376 | -object rng-random,filename=/dev/urandom,id=rng0 \ |
| 377 | -device virtio-rng-pci,rng=rng0,max-bytes=1024,period=1000 |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 378 | |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 379 | ifeq ($(QEMU_VIRTFS_ENABLE),y) |
Jerome Forissier | 23b4131 | 2016-11-12 16:02:01 +0100 | [diff] [blame] | 380 | QEMU_CONFIGURE_PARAMS_COMMON += --enable-virtfs |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 381 | QEMU_EXTRA_ARGS +=\ |
| 382 | -fsdev local,id=fsdev0,path=$(QEMU_VIRTFS_HOST_DIR),security_model=none \ |
| 383 | -device virtio-9p-device,fsdev=fsdev0,mount_tag=host |
Roland Nagy | 206aa46 | 2020-06-24 18:04:45 +0200 | [diff] [blame] | 384 | ifeq ($(QEMU_PSS_ENABLE),y) |
| 385 | QEMU_EXTRA_ARGS +=\ |
| 386 | -fsdev local,id=fsdev1,path=$(QEMU_PSS_HOST_DIR),security_model=none \ |
| 387 | -device virtio-9p-device,fsdev=fsdev1,mount_tag=secure |
| 388 | endif |
Igor Opaniuk | 97d0529 | 2016-10-26 14:46:14 +0300 | [diff] [blame] | 389 | endif |
Igor Opaniuk | 0aea4ef | 2017-01-13 12:52:00 +0200 | [diff] [blame] | 390 | |
Jerome Forissier | 129d3df | 2018-08-21 09:54:43 +0200 | [diff] [blame] | 391 | ifeq ($(GDBSERVER),y) |
| 392 | HOSTFWD := ,hostfwd=tcp::12345-:12345 |
| 393 | endif |
Jerome Forissier | 5e35a05 | 2018-08-21 10:01:32 +0200 | [diff] [blame] | 394 | # Enable QEMU SLiRP user networking |
Jerome Forissier | 129d3df | 2018-08-21 09:54:43 +0200 | [diff] [blame] | 395 | QEMU_EXTRA_ARGS +=\ |
| 396 | -netdev user,id=vmnic$(HOSTFWD) -device virtio-net-device,netdev=vmnic |
Jerome Forissier | efd5629 | 2017-01-31 17:46:10 +0100 | [diff] [blame] | 397 | |
| 398 | define run-help |
| 399 | @echo |
| 400 | @echo \* QEMU is now waiting to start the execution |
| 401 | @echo \* Start execution with either a \'c\' followed by \<enter\> in the QEMU console or |
| 402 | @echo \* attach a debugger and continue from there. |
| 403 | @echo \* |
| 404 | @echo \* To run OP-TEE tests, use the xtest command in the \'Normal World\' terminal |
| 405 | @echo \* Enter \'xtest -h\' for help. |
| 406 | @echo |
| 407 | endef |
| 408 | |
Jerome Forissier | 5b58525 | 2017-08-03 13:22:21 +0200 | [diff] [blame] | 409 | ifneq (, $(LAUNCH_TERMINAL)) |
Alex Bennée | 0758060 | 2017-07-07 14:26:51 +0100 | [diff] [blame] | 410 | define launch-terminal |
| 411 | @nc -z 127.0.0.1 $(1) || \ |
Hashem Tatari | 72b934f | 2019-01-24 16:43:43 +0100 | [diff] [blame] | 412 | $(LAUNCH_TERMINAL) "$(SOC_TERM_PATH)/soc_term $(1)" & |
Alex Bennée | 0758060 | 2017-07-07 14:26:51 +0100 | [diff] [blame] | 413 | endef |
| 414 | else |
Jerome Forissier | efd5629 | 2017-01-31 17:46:10 +0100 | [diff] [blame] | 415 | gnome-terminal := $(shell command -v gnome-terminal 2>/dev/null) |
| 416 | xterm := $(shell command -v xterm 2>/dev/null) |
| 417 | ifdef gnome-terminal |
Jerome Forissier | efd5629 | 2017-01-31 17:46:10 +0100 | [diff] [blame] | 418 | define launch-terminal |
| 419 | @nc -z 127.0.0.1 $(1) || \ |
Joakim Bech | 5dc030c | 2019-04-23 15:36:48 +0200 | [diff] [blame] | 420 | $(gnome-terminal) -x $(SOC_TERM_PATH)/soc_term $(1) & |
Jerome Forissier | efd5629 | 2017-01-31 17:46:10 +0100 | [diff] [blame] | 421 | endef |
| 422 | else |
| 423 | ifdef xterm |
| 424 | define launch-terminal |
| 425 | @nc -z 127.0.0.1 $(1) || \ |
| 426 | $(xterm) -title $(2) -e $(BASH) -c "$(SOC_TERM_PATH)/soc_term $(1)" & |
| 427 | endef |
| 428 | else |
| 429 | check-terminal := @echo "Error: could not find gnome-terminal nor xterm" ; false |
| 430 | endif |
| 431 | endif |
Alex Bennée | 0758060 | 2017-07-07 14:26:51 +0100 | [diff] [blame] | 432 | endif |
Jerome Forissier | efd5629 | 2017-01-31 17:46:10 +0100 | [diff] [blame] | 433 | |
| 434 | define wait-for-ports |
| 435 | @while ! nc -z 127.0.0.1 $(1) || ! nc -z 127.0.0.1 $(2); do sleep 1; done |
| 436 | endef |
| 437 | |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 438 | ################################################################################ |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 439 | # OP-TEE |
| 440 | ################################################################################ |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 441 | OPTEE_OS_COMMON_FLAGS ?= \ |
| 442 | $(OPTEE_OS_COMMON_EXTRA_FLAGS) \ |
Etienne Carriere | 3768a2b | 2019-05-14 17:13:19 +0200 | [diff] [blame] | 443 | PLATFORM=$(OPTEE_OS_PLATFORM) \ |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 444 | CROSS_COMPILE=$(CROSS_COMPILE_S_USER) \ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 445 | CROSS_COMPILE_core=$(CROSS_COMPILE_S_KERNEL) \ |
Jerome Forissier | e67d879 | 2019-09-06 17:40:03 +0200 | [diff] [blame] | 446 | CROSS_COMPILE_ta_arm64="$(CCACHE)$(AARCH64_CROSS_COMPILE)" \ |
| 447 | CROSS_COMPILE_ta_arm32="$(CCACHE)$(AARCH32_CROSS_COMPILE)" \ |
Pascal Brand | 23ef205 | 2016-03-09 15:25:01 +0100 | [diff] [blame] | 448 | CFG_TEE_CORE_LOG_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) \ |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 449 | DEBUG=$(DEBUG) \ |
| 450 | CFG_TEE_BENCHMARK=$(CFG_TEE_BENCHMARK) |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 451 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 452 | .PHONY: optee-os-common |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 453 | optee-os-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 454 | $(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS) |
| 455 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 456 | .PHONY: optee-os-clean-common |
Igor Opaniuk | 4f667cd | 2017-05-31 14:11:56 +0300 | [diff] [blame] | 457 | ifeq ($(CFG_TEE_BENCHMARK),y) |
| 458 | optee-os-clean-common: benchmark-app-clean-common |
| 459 | endif |
Jens Wiklander | ccd829a | 2018-02-05 20:30:39 +0100 | [diff] [blame] | 460 | optee-os-clean-common: xtest-clean-common optee-examples-clean-common |
Etienne Carriere | 3768a2b | 2019-05-14 17:13:19 +0200 | [diff] [blame] | 461 | $(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS) clean |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 462 | |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 463 | OPTEE_CLIENT_COMMON_FLAGS ?= CROSS_COMPILE=$(CROSS_COMPILE_NS_USER) \ |
| 464 | CFG_TEE_BENCHMARK=$(CFG_TEE_BENCHMARK) \ |
Victor Chong | ed79f25 | 2019-04-27 16:54:51 +0100 | [diff] [blame] | 465 | CFG_TA_TEST_PATH=y |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 466 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 467 | .PHONY: optee-client-common |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 468 | optee-client-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 469 | $(MAKE) -C $(OPTEE_CLIENT_PATH) $(OPTEE_CLIENT_COMMON_FLAGS) |
| 470 | |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 471 | # OPTEE_CLIENT_CLEAN_COMMON_FLAGS can be defined in specific makefiles |
| 472 | # (hikey.mk,...) if necessary |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 473 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 474 | .PHONY: optee-client-clean-common |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 475 | optee-client-clean-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 476 | $(MAKE) -C $(OPTEE_CLIENT_PATH) $(OPTEE_CLIENT_CLEAN_COMMON_FLAGS) \ |
| 477 | clean |
| 478 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 479 | ################################################################################ |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 480 | # xtest / optee_test |
| 481 | ################################################################################ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 482 | XTEST_COMMON_FLAGS ?= CROSS_COMPILE_HOST=$(CROSS_COMPILE_NS_USER)\ |
| 483 | CROSS_COMPILE_TA=$(CROSS_COMPILE_S_USER) \ |
| 484 | TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) \ |
Etienne Carriere | 5e11351 | 2016-10-21 10:13:57 +0200 | [diff] [blame] | 485 | OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \ |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 486 | COMPILE_NS_USER=$(COMPILE_NS_USER) \ |
Igor Opaniuk | 4f667cd | 2017-05-31 14:11:56 +0300 | [diff] [blame] | 487 | O=$(OPTEE_TEST_OUT_PATH) |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 488 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 489 | .PHONY: xtest-common |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 490 | xtest-common: optee-os optee-client |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 491 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_COMMON_FLAGS) |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 492 | |
Etienne Carriere | 965db7b | 2017-01-10 17:50:21 +0100 | [diff] [blame] | 493 | XTEST_CLEAN_COMMON_FLAGS ?= O=$(OPTEE_TEST_OUT_PATH) \ |
| 494 | TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) \ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 495 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 496 | .PHONY: xtest-clean-common |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 497 | xtest-clean-common: |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 498 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_CLEAN_COMMON_FLAGS) clean |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 499 | |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 500 | XTEST_PATCH_COMMON_FLAGS ?= $(XTEST_COMMON_FLAGS) |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 501 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 502 | .PHONY: xtest-patch-common |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 503 | xtest-patch-common: |
| 504 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_PATCH_COMMON_FLAGS) patch |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 505 | |
| 506 | ################################################################################ |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 507 | # sample applications / optee_examples |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 508 | ################################################################################ |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 509 | OPTEE_EXAMPLES_COMMON_FLAGS ?= HOST_CROSS_COMPILE=$(CROSS_COMPILE_NS_USER)\ |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 510 | TA_CROSS_COMPILE=$(CROSS_COMPILE_S_USER) \ |
| 511 | TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) \ |
| 512 | TEEC_EXPORT=$(OPTEE_CLIENT_EXPORT) |
| 513 | |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 514 | .PHONY: optee-examples-common |
| 515 | optee-examples-common: optee-os optee-client |
| 516 | $(MAKE) -C $(OPTEE_EXAMPLES_PATH) $(OPTEE_EXAMPLES_COMMON_FLAGS) |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 517 | |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 518 | OPTEE_EXAMPLES_CLEAN_COMMON_FLAGS ?= TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 519 | |
Igor Opaniuk | 584efe5 | 2017-08-07 01:41:48 +0300 | [diff] [blame] | 520 | .PHONY: optee-examples-clean-common |
| 521 | optee-examples-clean-common: |
| 522 | $(MAKE) -C $(OPTEE_EXAMPLES_PATH) \ |
| 523 | $(OPTEE_EXAMPLES_CLEAN_COMMON_FLAGS) clean |
Etienne Carriere | 5e11351 | 2016-10-21 10:13:57 +0200 | [diff] [blame] | 524 | |
| 525 | ################################################################################ |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 526 | # benchmark_app |
| 527 | ################################################################################ |
Yves Lefloch | 221154a | 2017-08-02 17:36:58 +0200 | [diff] [blame] | 528 | BENCHMARK_APP_COMMON_FLAGS ?= CROSS_COMPILE=$(CROSS_COMPILE_NS_USER) \ |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 529 | TEEC_EXPORT=$(OPTEE_CLIENT_EXPORT) \ |
Igor Opaniuk | 7b3a94c | 2017-09-13 13:15:30 +0300 | [diff] [blame] | 530 | TEEC_INTERNAL_INCLUDES=$(OPTEE_CLIENT_PATH)/libteec \ |
| 531 | MULTIARCH=$(MULTIARCH) |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 532 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 533 | .PHONY: benchmark-app-common |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 534 | benchmark-app-common: optee-os optee-client |
Etienne Carriere | ef7253c | 2019-05-14 17:16:36 +0200 | [diff] [blame] | 535 | $(MAKE) -C $(OPTEE_BENCHMARK_PATH) $(BENCHMARK_APP_COMMON_FLAGS) |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 536 | |
Victor Chong | 46f8585 | 2017-08-09 08:26:41 +0100 | [diff] [blame] | 537 | .PHONY: benchmark-app-clean-common |
Igor Opaniuk | 27edfc7 | 2016-10-25 18:33:54 +0300 | [diff] [blame] | 538 | benchmark-app-clean-common: |
Etienne Carriere | ef7253c | 2019-05-14 17:16:36 +0200 | [diff] [blame] | 539 | $(MAKE) -C $(OPTEE_BENCHMARK_PATH) clean |