blob: fb96c68dfa71da8c48251fe437784443dbffa21d [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
Jerome Forissier5ef74e72016-08-06 10:47:12 +020029PLATFORM_$(PLATFORM) := y
30PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y
Pascal Brandb0104772014-06-12 15:56:20 +020031arch_$(ARCH) := y
32
Pascal Brandb0104772014-06-12 15:56:20 +020033ifneq ($O,)
Jerome Forissier4334e8d2014-09-08 10:53:42 +020034out-dir := $O
Pascal Brandb0104772014-06-12 15:56:20 +020035endif
36
37ifneq ($V,1)
38q := @
39cmd-echo := true
Jens Wiklander62428632015-04-29 15:05:19 +020040cmd-echo-silent := echo
Pascal Brandb0104772014-06-12 15:56:20 +020041else
42q :=
43cmd-echo := echo
Jens Wiklander62428632015-04-29 15:05:19 +020044cmd-echo-silent := true
Pascal Brandb0104772014-06-12 15:56:20 +020045endif
46
Jens Wiklander62428632015-04-29 15:05:19 +020047ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
48ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
49cmd-echo-silent := true
50endif
51else # make-3.8x
Pascal Brand3dc79b02015-05-28 14:02:47 +020052ifneq ($(findstring s, $(MAKEFLAGS)),)
Jens Wiklander62428632015-04-29 15:05:19 +020053cmd-echo-silent := true
54endif
55endif
56
57
Pascal Brandb0104772014-06-12 15:56:20 +020058include core/core.mk
59
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010060# Platform config is supposed to assign the targets
61ta-targets ?= user_ta
62
Jens Wiklander6fbac372015-11-05 14:22:05 +010063ifeq ($(CFG_WITH_USER_TA),y)
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010064define build-ta-target
65ta-target := $(1)
Pascal Brandb0104772014-06-12 15:56:20 +020066include ta/ta.mk
Jens Wiklanderbc33bbd2015-11-11 14:08:26 +010067endef
68$(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
Jens Wiklander6fbac372015-11-05 14:22:05 +010069endif
Pascal Brandb0104772014-06-12 15:56:20 +020070
71.PHONY: clean
72clean:
Jens Wiklander62428632015-04-29 15:05:19 +020073 @$(cmd-echo-silent) ' CLEAN .'
Pascal Brandb0104772014-06-12 15:56:20 +020074 ${q}rm -f $(cleanfiles)
75
76.PHONY: cscope
77cscope:
Jerome Forissier0047cb62014-09-01 13:41:48 +020078 @echo ' CSCOPE .'
Pascal Brandb0104772014-06-12 15:56:20 +020079 ${q}rm -f cscope.*
80 ${q}find $(PWD) -name "*.[chSs]" > cscope.files
81 ${q}cscope -b -q -k