blob: 718efc613733906e448e9655f6ef8899ab6d3ee3 [file] [log] [blame]
Pascal Brandb0104772014-06-12 15:56:20 +02001SHELL = /bin/bash
2
3.PHONY: all
4all:
5
Jens Wiklander29f1a452014-08-29 08:26:57 +02006.PHONY: mem_usage
7mem_usage:
8
etienne carrieredde0e232015-02-26 10:29:27 +01009# 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
Jerome Forissier71767a52014-10-29 14:43:11 +010016# 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
Pascal Brandb0104772014-06-12 15:56:20 +020023# Make these default for now
Jens Wiklanderabe38972015-03-09 08:46:51 +010024ARCH ?= arm
Pascal Brand92542a72014-08-29 10:50:38 +020025PLATFORM ?= stm
Pascal Brandb0104772014-06-12 15:56:20 +020026O ?= out/$(ARCH)-plat-$(PLATFORM)
27
28arch_$(ARCH) := y
29
Pascal Brandb0104772014-06-12 15:56:20 +020030ifneq ($O,)
Jerome Forissier4334e8d2014-09-08 10:53:42 +020031out-dir := $O
Pascal Brandb0104772014-06-12 15:56:20 +020032endif
33
34ifneq ($V,1)
35q := @
36cmd-echo := true
Jens Wiklander62428632015-04-29 15:05:19 +020037cmd-echo-silent := echo
Pascal Brandb0104772014-06-12 15:56:20 +020038else
39q :=
40cmd-echo := echo
Jens Wiklander62428632015-04-29 15:05:19 +020041cmd-echo-silent := true
Pascal Brandb0104772014-06-12 15:56:20 +020042endif
43
Jens Wiklander62428632015-04-29 15:05:19 +020044ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
45ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
46cmd-echo-silent := true
47endif
48else # make-3.8x
49ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
50cmd-echo-silent := true
51endif
52endif
53
54
Pascal Brandb0104772014-06-12 15:56:20 +020055include core/core.mk
56
57include ta/ta.mk
58
59.PHONY: clean
60clean:
Jens Wiklander62428632015-04-29 15:05:19 +020061 @$(cmd-echo-silent) ' CLEAN .'
Pascal Brandb0104772014-06-12 15:56:20 +020062 ${q}rm -f $(cleanfiles)
63
64.PHONY: cscope
65cscope:
Jerome Forissier0047cb62014-09-01 13:41:48 +020066 @echo ' CSCOPE .'
Pascal Brandb0104772014-06-12 15:56:20 +020067 ${q}rm -f cscope.*
68 ${q}find $(PWD) -name "*.[chSs]" > cscope.files
69 ${q}cscope -b -q -k