-
Notifications
You must be signed in to change notification settings - Fork 198
/
Makefile
95 lines (81 loc) · 2.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
ifeq ($O,)
out-dir := $(CURDIR)/out
else
include scripts/common.mk
out-dir := $(call strip-trailing-slashes-and-dots,$(O))
ifeq ($(out-dir),)
$(error invalid output directory (O=$(O)))
endif
endif
bindir ?= /bin
libdir ?= /lib
-include $(TA_DEV_KIT_DIR)/host_include/conf.mk
-include $(OPTEE_CLIENT_EXPORT)/include/optee_client_config.mk
ifneq ($V,1)
q := @
echo := @echo
else
q :=
echo := @:
endif
# export 'q', used by sub-makefiles.
export q
# If _HOST or _TA specific compilers are not specified, then use CROSS_COMPILE
CROSS_COMPILE_HOST ?= $(CROSS_COMPILE)
CROSS_COMPILE_TA ?= $(CROSS_COMPILE)
.PHONY: all
ifneq ($(wildcard $(TA_DEV_KIT_DIR)/host_include/conf.mk),)
all: xtest ta test_plugin
else
all:
$(q)echo "TA_DEV_KIT_DIR is not correctly defined" && false
endif
.PHONY: xtest
xtest:
$(q)$(MAKE) -C host/xtest CROSS_COMPILE="$(CROSS_COMPILE_HOST)" \
--no-builtin-variables \
O=$(out-dir) \
$@
.PHONY: ta
ta:
$(q)$(MAKE) -C ta CROSS_COMPILE="$(CROSS_COMPILE_TA)" \
O=$(out-dir) \
$@
.PHONY: test_plugin
test_plugin:
$(q)$(MAKE) -C host/supp_plugin CROSS_COMPILE="$(CROSS_COMPILE_HOST)" \
--no-builtin-variables \
O=$(out-dir)
.PHONY: clean
ifneq ($(wildcard $(TA_DEV_KIT_DIR)/host_include/conf.mk),)
clean:
$(q)$(MAKE) -C host/xtest O=$(out-dir) $@
$(q)$(MAKE) -C ta O=$(out-dir) $@
$(q)$(MAKE) -C host/supp_plugin O=$(out-dir) $@
else
clean:
$(q)echo "TA_DEV_KIT_DIR is not correctly defined"
$(q)echo "You can remove manually $(out-dir)"
endif
.PHONY: checkpatch checkpatch-staging checkpatch-working
checkpatch: checkpatch-staging checkpatch-working
checkpatch-working:
@./scripts/checkpatch.sh
checkpatch-staging:
@./scripts/checkpatch.sh --cached
install:
$(echo) ' INSTALL ${DESTDIR}${libdir}/optee_armtz'
$(q)mkdir -p ${DESTDIR}${libdir}/optee_armtz
$(q)find $(out-dir) -name \*.ta -exec cp {} ${DESTDIR}${libdir}/optee_armtz \;
$(echo) ' INSTALL ${DESTDIR}${bindir}'
$(q)mkdir -p ${DESTDIR}${bindir}
$(q)cp $(out-dir)/xtest/xtest ${DESTDIR}${bindir}
$(echo) ' INSTALL ${DESTDIR}/$(CFG_TEE_PLUGIN_LOAD_PATH)'
$(q)mkdir -p ${DESTDIR}/$(CFG_TEE_PLUGIN_LOAD_PATH)
$(q)cp $(out-dir)/supp_plugin/*.plugin ${DESTDIR}/$(CFG_TEE_PLUGIN_LOAD_PATH)
.PHONY: cscope
cscope:
$(echo) ' CSCOPE .'
${q}rm -f cscope.*
${q}find $(PWD) -name "*.[ch]" -o -name "*.cpp" | grep -v /package/ > cscope.files
${q}cscope -b -q -k