xref: /optee_os/Makefile (revision 30d13250c390c4f56adefdcd3b64b7cc672f9fe2)
1SHELL = /bin/bash
2
3.PHONY: all
4all:
5
6.PHONY: mem_usage
7mem_usage:
8
9# log and load eventual tee config file
10# path is absolute or relative to current source root directory.
11ifdef CFG_OPTEE_CONFIG
12$(info Loading OPTEE configuration file $(CFG_OPTEE_CONFIG))
13include $(CFG_OPTEE_CONFIG)
14endif
15
16# If $(PLATFORM) is defined and contains a hyphen, parse it as
17# $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience
18ifneq (,$(findstring -,$(PLATFORM)))
19ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM))))
20$(foreach op,$(ops),$(eval override $(op)))
21endif
22
23# Make these default for now
24ARCH            ?= arm
25PLATFORM        ?= vexpress
26# Default value for PLATFORM_FLAVOR is set in plat-$(PLATFORM)/conf.mk
27O		?= out/$(ARCH)-plat-$(PLATFORM)
28
29arch_$(ARCH)	:= y
30
31ifneq ($O,)
32out-dir := $O
33endif
34
35ifneq ($V,1)
36q := @
37cmd-echo := true
38cmd-echo-silent := echo
39else
40q :=
41cmd-echo := echo
42cmd-echo-silent := true
43endif
44
45ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
46ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
47cmd-echo-silent := true
48endif
49else                                    # make-3.8x
50ifneq ($(findstring s, $(MAKEFLAGS)),)
51cmd-echo-silent := true
52endif
53endif
54
55
56include core/core.mk
57
58# Platform config is supposed to assign the targets
59ta-targets ?= user_ta
60
61ifeq ($(CFG_WITH_USER_TA),y)
62define build-ta-target
63ta-target := $(1)
64include ta/ta.mk
65endef
66$(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
67endif
68
69.PHONY: clean
70clean:
71	@$(cmd-echo-silent) '  CLEAN   .'
72	${q}rm -f $(cleanfiles)
73
74.PHONY: cscope
75cscope:
76	@echo '  CSCOPE  .'
77	${q}rm -f cscope.*
78	${q}find $(PWD) -name "*.[chSs]" > cscope.files
79	${q}cscope -b -q -k
80