blob: 5eceb079e1e72754cd0614e11941b0f7234a8508 [file] [log] [blame]
Pascal Brandc639ac82015-07-02 08:53:34 +02001# Normally this makefile shouldn't be called directly and we expect the output
2# path to be on a certain location to fit together with the other OP-TEE
3# gits and helper scripts.
Etienne Carriere3ddc3622017-03-13 15:31:15 +01004
5include ../scripts/common.mk
6out-dir := $(call strip-trailing-slashes-and-dots,$(O))
7ifeq ($(out-dir),)
8$(error invalid output directory (O=$(O)))
Pascal Brandc639ac82015-07-02 08:53:34 +02009endif
10
Sumit Garg0e009142015-11-04 15:34:07 -050011# Prevent use of LDFLAGS from the environment. For example, yocto exports
12# LDFLAGS that are suitable for the client applications, not for TAs
13LDFLAGS=
14
Pascal Brandc639ac82015-07-02 08:53:34 +020015TA_DIRS := create_fail_test \
16 crypt \
17 os_test \
18 rpc_test \
19 sims \
Jens Wiklanderac27ec12015-07-15 15:23:14 +020020 storage \
Jerome Forissiere3854162016-08-12 12:40:12 +020021 storage2 \
James Kungdf1e6cf2015-09-14 22:42:24 +080022 concurrent \
Jens Wiklander70672972016-04-06 00:01:45 +020023 concurrent_large \
Igor Opaniuk136644a2016-09-13 13:40:56 +030024 storage_benchmark \
Igor Opaniuk44aff4b2016-09-16 10:18:00 +030025 sha_perf \
Jens Wiklander02389a92016-12-16 11:13:38 +010026 aes_perf \
27 socket
Pascal Brandc639ac82015-07-02 08:53:34 +020028
Etienne Carriere41343db2017-03-17 15:38:52 +010029ifeq ($(CFG_SECURE_DATA_PATH),y)
30TA_DIRS += sdp_basic
31endif
32
Jerome Forissiere3688342015-09-24 10:45:17 -070033ifdef CFG_GP_PACKAGE_PATH
Pascal Brandc639ac82015-07-02 08:53:34 +020034TA_DIRS += GP_TTA_Arithmetical \
35 GP_TTA_Crypto \
36 GP_TTA_DS \
37 GP_TTA_TCF \
38 GP_TTA_TCF_ICA \
39 GP_TTA_TCF_ICA2 \
40 GP_TTA_TCF_MultipleInstanceTA \
41 GP_TTA_TCF_SingleInstanceTA \
42 GP_TTA_Time \
43 GP_TTA_answerErrorTo_Invoke \
44 GP_TTA_answerErrorTo_OpenSession \
45 GP_TTA_answerSuccessTo_OpenSession_Invoke \
46 GP_TTA_check_OpenSession_with_4_parameters \
47 GP_TTA_testingClientAPI
48endif
49
50.PHONY: all
51all: ta
52
53.PHONY: ta
54ta:
Etienne Carriere3ddc3622017-03-13 15:31:15 +010055 $(q)$(foreach dir,$(TA_DIRS), $(MAKE) -C $(dir) O=$(out-dir)/ta/$(dir) &&) true
56
57# remove build directories including ta/<ta-name>/ directories.
58# Note: $(out-dir) may be a relative path.
59RMDIR := rmdir --ignore-fail-on-non-empty
60define rm-build-subdir
61echo `[ -d $1 ] && { cd $1; $(RMDIR) $(out-dir)/ta $(out-dir) 2> /dev/null; true; }` > /dev/null
62endef
Pascal Brandc639ac82015-07-02 08:53:34 +020063
64.PHONY: clean
65clean:
Etienne Carriere8a6ed862017-03-13 15:30:54 +010066 $(q)$(foreach dir,$(TA_DIRS), [ ! -d $(dir) ] || $(MAKE) -C $(dir) O=$(out-dir)/ta/$(dir) $@ &&) true
Etienne Carriere3ddc3622017-03-13 15:31:15 +010067 $(q)$(foreach dir,$(TA_DIRS), $(call rm-build-subdir,$(dir));)