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