xref: /optee_os/Makefile (revision 316a94e710afc8dcb5b6ac991741ac6370af65fc)
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        ?= stm
26O		?= out/$(ARCH)-plat-$(PLATFORM)
27
28arch_$(ARCH)	:= y
29
30ifneq ($O,)
31out-dir := $O
32endif
33
34ifneq ($V,1)
35q := @
36cmd-echo := true
37cmd-echo-silent := echo
38else
39q :=
40cmd-echo := echo
41cmd-echo-silent := true
42endif
43
44ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
45ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
46cmd-echo-silent := true
47endif
48else                                    # make-3.8x
49ifneq ($(findstring s, $(MAKEFLAGS)),)
50cmd-echo-silent := true
51endif
52endif
53
54
55include core/core.mk
56
57include ta/ta.mk
58
59.PHONY: clean
60clean:
61	@$(cmd-echo-silent) '  CLEAN   .'
62	${q}rm -f $(cleanfiles)
63
64.PHONY: cscope
65cscope:
66	@echo '  CSCOPE  .'
67	${q}rm -f cscope.*
68	${q}find $(PWD) -name "*.[chSs]" > cscope.files
69	${q}cscope -b -q -k
70