Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 1 | SHELL = /bin/bash |
| 2 | |
| 3 | .PHONY: all |
| 4 | all: |
| 5 | |
Jens Wiklander | 29f1a45 | 2014-08-29 08:26:57 +0200 | [diff] [blame] | 6 | .PHONY: mem_usage |
| 7 | mem_usage: |
| 8 | |
etienne carriere | dde0e23 | 2015-02-26 10:29:27 +0100 | [diff] [blame] | 9 | # log and load eventual tee config file |
| 10 | # path is absolute or relative to current source root directory. |
| 11 | ifdef CFG_OPTEE_CONFIG |
| 12 | $(info Loading OPTEE configuration file $(CFG_OPTEE_CONFIG)) |
| 13 | include $(CFG_OPTEE_CONFIG) |
| 14 | endif |
| 15 | |
Jerome Forissier | 71767a5 | 2014-10-29 14:43:11 +0100 | [diff] [blame] | 16 | # If $(PLATFORM) is defined and contains a hyphen, parse it as |
| 17 | # $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience |
| 18 | ifneq (,$(findstring -,$(PLATFORM))) |
| 19 | ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM)))) |
| 20 | $(foreach op,$(ops),$(eval override $(op))) |
| 21 | endif |
| 22 | |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 23 | # Make these default for now |
Jens Wiklander | abe3897 | 2015-03-09 08:46:51 +0100 | [diff] [blame] | 24 | ARCH ?= arm |
Pascal Brand | 92542a7 | 2014-08-29 10:50:38 +0200 | [diff] [blame] | 25 | PLATFORM ?= stm |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 26 | O ?= out/$(ARCH)-plat-$(PLATFORM) |
| 27 | |
| 28 | arch_$(ARCH) := y |
| 29 | |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 30 | ifneq ($O,) |
Jerome Forissier | 4334e8d | 2014-09-08 10:53:42 +0200 | [diff] [blame] | 31 | out-dir := $O |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 32 | endif |
| 33 | |
| 34 | ifneq ($V,1) |
| 35 | q := @ |
| 36 | cmd-echo := true |
Jens Wiklander | 6242863 | 2015-04-29 15:05:19 +0200 | [diff] [blame^] | 37 | cmd-echo-silent := echo |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 38 | else |
| 39 | q := |
| 40 | cmd-echo := echo |
Jens Wiklander | 6242863 | 2015-04-29 15:05:19 +0200 | [diff] [blame^] | 41 | cmd-echo-silent := true |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 42 | endif |
| 43 | |
Jens Wiklander | 6242863 | 2015-04-29 15:05:19 +0200 | [diff] [blame^] | 44 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 |
| 45 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) |
| 46 | cmd-echo-silent := true |
| 47 | endif |
| 48 | else # make-3.8x |
| 49 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) |
| 50 | cmd-echo-silent := true |
| 51 | endif |
| 52 | endif |
| 53 | |
| 54 | |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 55 | include core/core.mk |
| 56 | |
| 57 | include ta/ta.mk |
| 58 | |
| 59 | .PHONY: clean |
| 60 | clean: |
Jens Wiklander | 6242863 | 2015-04-29 15:05:19 +0200 | [diff] [blame^] | 61 | @$(cmd-echo-silent) ' CLEAN .' |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 62 | ${q}rm -f $(cleanfiles) |
| 63 | |
| 64 | .PHONY: cscope |
| 65 | cscope: |
Jerome Forissier | 0047cb6 | 2014-09-01 13:41:48 +0200 | [diff] [blame] | 66 | @echo ' CSCOPE .' |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 67 | ${q}rm -f cscope.* |
| 68 | ${q}find $(PWD) -name "*.[chSs]" > cscope.files |
| 69 | ${q}cscope -b -q -k |