Disable building repository with ASan extra packs.
[platform/core/security/tef-optee_os.git] / Makefile
1 SHELL = /bin/bash
2
3 # It can happen that a makefile calls us, which contains an 'export' directive
4 # or the '.EXPORT_ALL_VARIABLES:' special target. In this case, all the make
5 # variables are added to the environment for each line of the recipes, so that
6 # any sub-makefile can use them.
7 # We have observed this can cause issues such as 'Argument list too long'
8 # errors as the shell runs out of memory.
9 # Since this Makefile won't call any sub-makefiles, and since the commands do
10 # not expect to implicitely obtain any make variable from the environment, we
11 # can safely cancel this export mechanism. Unfortunately, it can't be done
12 # globally, only by name. Let's unexport MAKEFILE_LIST which is by far the
13 # biggest one due to our way of tracking dependencies and compile flags
14 # (we include many *.cmd and *.d files).
15 unexport MAKEFILE_LIST
16
17 .PHONY: all
18 all:
19
20 .PHONY: mem_usage
21 mem_usage:
22
23 # log and load eventual tee config file
24 # path is absolute or relative to current source root directory.
25 ifdef CFG_OPTEE_CONFIG
26 $(info Loading OPTEE configuration file $(CFG_OPTEE_CONFIG))
27 include $(CFG_OPTEE_CONFIG)
28 endif
29
30 # If $(PLATFORM) is defined and contains a hyphen, parse it as
31 # $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience
32 ifneq (,$(findstring -,$(PLATFORM)))
33 ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM))))
34 $(foreach op,$(ops),$(eval override $(op)))
35 endif
36
37 # Make these default for now
38 ARCH            ?= arm
39 PLATFORM        ?= vexpress
40 # Default value for PLATFORM_FLAVOR is set in plat-$(PLATFORM)/conf.mk
41 ifeq ($O,)
42 O               := out
43 out-dir         := $(O)/$(ARCH)-plat-$(PLATFORM)
44 else
45 out-dir         := $(O)
46 endif
47
48 arch_$(ARCH)    := y
49
50 ifneq ($V,1)
51 q := @
52 cmd-echo := true
53 cmd-echo-silent := echo
54 else
55 q :=
56 cmd-echo := echo
57 cmd-echo-silent := true
58 endif
59
60 ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
61 ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
62 cmd-echo-silent := true
63 endif
64 else                                    # make-3.8x
65 ifneq ($(findstring s, $(MAKEFLAGS)),)
66 cmd-echo-silent := true
67 endif
68 endif
69
70
71 include core/core.mk
72
73 # Platform config is supposed to assign the targets
74 ta-targets ?= user_ta
75
76 ifeq ($(CFG_WITH_USER_TA),y)
77 define build-ta-target
78 ta-target := $(1)
79 include ta/ta.mk
80 endef
81 $(foreach t, $(ta-targets), $(eval $(call build-ta-target, $(t))))
82 endif
83
84 include mk/cleandirs.mk
85
86 .PHONY: clean
87 clean:
88         @$(cmd-echo-silent) '  CLEAN   $(out-dir)'
89         ${q}rm -f $(cleanfiles)
90         ${q}dirs="$(call cleandirs-for-rmdir)"; if [ "$$dirs" ]; then $(RMDIR) $$dirs; fi
91         @if [ "$(out-dir)" != "$(O)" ]; then $(cmd-echo-silent) '  CLEAN   $(O)'; fi
92         ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi
93
94 .PHONY: cscope
95 cscope:
96         @echo '  CSCOPE  .'
97         ${q}rm -f cscope.*
98         ${q}find $(PWD) -name "*.[chSs]" > cscope.files
99         ${q}cscope -b -q -k