blob: f74b93f48df8b862fdbc0511e4953b7af3cd7c3d [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
Jerome Forissier9fc53172016-08-23 11:20:21 +020026# Default value for PLATFORM_FLAVOR is set in plat-$(PLATFORM)/conf.mk
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
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010058# Platform config is supposed to assign the targets
59ta-targets ?= user_ta
60
Jens Wiklander6fbac372015-11-05 14:22:05 +010061ifeq ($(CFG_WITH_USER_TA),y)
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010062define build-ta-target
63ta-target := $(1)
Pascal Brandb0104772014-06-12 15:56:20 +020064include ta/ta.mk
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010065endef
66$(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
Jens Wiklander6fbac372015-11-05 14:22:05 +010067endif
Pascal Brandb0104772014-06-12 15:56:20 +020068
69.PHONY: clean
70clean:
Jens Wiklander62428632015-04-29 15:05:19 +020071 @$(cmd-echo-silent) ' CLEAN .'
Pascal Brandb0104772014-06-12 15:56:20 +020072 ${q}rm -f $(cleanfiles)
73
74.PHONY: cscope
75cscope:
Jerome Forissier0047cb62014-09-01 13:41:48 +020076 @echo ' CSCOPE .'
Pascal Brandb0104772014-06-12 15:56:20 +020077 ${q}rm -f cscope.*
78 ${q}find $(PWD) -name "*.[chSs]" > cscope.files
79 ${q}cscope -b -q -k