blob: 29fed60793a7606807f9abb75273e86ec32a14ac [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
Jerome Forissiera75f2e12015-07-07 19:07:50 +020025PLATFORM ?= vexpress
26PLATFORM_FLAVOR ?= qemu_virt
Pascal Brandb0104772014-06-12 15:56:20 +020027O ?= out/$(ARCH)-plat-$(PLATFORM)
28
29arch_$(ARCH) := y
30
Pascal Brandb0104772014-06-12 15:56:20 +020031ifneq ($O,)
Jerome Forissier4334e8d2014-09-08 10:53:42 +020032out-dir := $O
Pascal Brandb0104772014-06-12 15:56:20 +020033endif
34
35ifneq ($V,1)
36q := @
37cmd-echo := true
Jens Wiklander62428632015-04-29 15:05:19 +020038cmd-echo-silent := echo
Pascal Brandb0104772014-06-12 15:56:20 +020039else
40q :=
41cmd-echo := echo
Jens Wiklander62428632015-04-29 15:05:19 +020042cmd-echo-silent := true
Pascal Brandb0104772014-06-12 15:56:20 +020043endif
44
Jens Wiklander62428632015-04-29 15:05:19 +020045ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
46ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
47cmd-echo-silent := true
48endif
49else # make-3.8x
Pascal Brand3dc79b02015-05-28 14:02:47 +020050ifneq ($(findstring s, $(MAKEFLAGS)),)
Jens Wiklander62428632015-04-29 15:05:19 +020051cmd-echo-silent := true
52endif
53endif
54
55
Pascal Brandb0104772014-06-12 15:56:20 +020056include core/core.mk
57
58include ta/ta.mk
59
60.PHONY: clean
61clean:
Jens Wiklander62428632015-04-29 15:05:19 +020062 @$(cmd-echo-silent) ' CLEAN .'
Pascal Brandb0104772014-06-12 15:56:20 +020063 ${q}rm -f $(cleanfiles)
64
65.PHONY: cscope
66cscope:
Jerome Forissier0047cb62014-09-01 13:41:48 +020067 @echo ' CSCOPE .'
Pascal Brandb0104772014-06-12 15:56:20 +020068 ${q}rm -f cscope.*
69 ${q}find $(PWD) -name "*.[chSs]" > cscope.files
70 ${q}cscope -b -q -k