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