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