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 ?= vexpress 26PLATFORM_FLAVOR ?= qemu_virt 27O ?= out/$(ARCH)-plat-$(PLATFORM) 28 29PLATFORM_$(PLATFORM) := y 30PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y 31arch_$(ARCH) := y 32 33ifneq ($O,) 34out-dir := $O 35endif 36 37ifneq ($V,1) 38q := @ 39cmd-echo := true 40cmd-echo-silent := echo 41else 42q := 43cmd-echo := echo 44cmd-echo-silent := true 45endif 46 47ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 48ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) 49cmd-echo-silent := true 50endif 51else # make-3.8x 52ifneq ($(findstring s, $(MAKEFLAGS)),) 53cmd-echo-silent := true 54endif 55endif 56 57 58include core/core.mk 59 60# Platform config is supposed to assign the targets 61ta-targets ?= user_ta 62 63ifeq ($(CFG_WITH_USER_TA),y) 64define build-ta-target 65ta-target := $(1) 66include ta/ta.mk 67endef 68$(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t)))) 69endif 70 71.PHONY: clean 72clean: 73 @$(cmd-echo-silent) ' CLEAN .' 74 ${q}rm -f $(cleanfiles) 75 76.PHONY: cscope 77cscope: 78 @echo ' CSCOPE .' 79 ${q}rm -f cscope.* 80 ${q}find $(PWD) -name "*.[chSs]" > cscope.files 81 ${q}cscope -b -q -k 82