xref: /OK3568_Linux_fs/external/security/rk_tee_user/v2/ta/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# Normally this makefile shouldn't be called directly and we expect the output
2# path to be on a certain location to fit together with the other OP-TEE
3# gits and helper scripts.
4
5include ../scripts/common.mk
6out-dir := $(call strip-trailing-slashes-and-dots,$(O))
7ifeq ($(out-dir),)
8$(error invalid output directory (O=$(O)))
9endif
10
11include $(TA_DEV_KIT_DIR)/mk/conf.mk
12
13# Prevent use of LDFLAGS from the environment. For example, yocto exports
14# LDFLAGS that are suitable for the client applications, not for TAs
15LDFLAGS=
16
17TA_DIRS := create_fail_test \
18	   crypt \
19	   os_test_lib \
20	   os_test_lib_dl \
21	   os_test \
22	   rpc_test \
23	   sims \
24	   miss \
25	   sims_keepalive \
26	   storage \
27	   storage2 \
28	   concurrent \
29	   concurrent_large \
30	   storage_benchmark \
31	   sha_perf \
32	   aes_perf \
33	   socket \
34	   supp_plugin \
35	   rk_test \
36	   extra_app
37
38ifeq ($(CFG_SECURE_DATA_PATH),y)
39TA_DIRS += sdp_basic
40endif
41
42.PHONY: all
43all: ta
44
45.PHONY: ta
46ta:
47	$(q)$(foreach dir,$(TA_DIRS), [ ! -d $(dir) ] || $(MAKE) -C $(dir) O=$(out-dir)/ta/$(dir) &&) true
48
49# remove build directories including ta/<ta-name>/ directories.
50# Note: $(out-dir) may be a relative path.
51RMDIR := rmdir --ignore-fail-on-non-empty
52define rm-build-subdir
53echo `[ -d $1 ] && { cd $1; $(RMDIR) $(out-dir)/ta $(out-dir) 2> /dev/null; true; }` > /dev/null
54endef
55
56.PHONY: clean
57clean:
58	$(q)$(foreach dir,$(TA_DIRS), [ ! -d $(dir) ] || $(MAKE) -C $(dir) O=$(out-dir)/ta/$(dir) $@ &&) true
59	$(q)$(foreach dir,$(TA_DIRS), $(call rm-build-subdir,$(dir));)
60