xref: /optee_os/core/core.mk (revision 3f4b5250f820ec567422230370fa94e3d6277265)
1include mk/cleanvars.mk
2
3# Set current submodule (used for module specific flags compile result etc)
4sm := core
5sm-$(sm) := y
6
7arch-dir	:= core/arch/$(ARCH)
8platform-dir	:= $(arch-dir)/plat-$(PLATFORM)
9include $(platform-dir)/conf.mk
10include core/arch/$(ARCH)/$(ARCH).mk
11
12# Setup compiler for this sub module
13CROSS_COMPILE_$(sm)	?= $(CROSS_COMPILE)
14COMPILER_$(sm)		?= $(COMPILER)
15include mk/$(COMPILER_$(sm)).mk
16
17PLATFORM_FLAVOR ?= default
18platform_$(PLATFORM) := y
19platform_flavor_$(PLATFORM_FLAVOR) := y
20cppflags$(sm)	+= -DPLATFORM_FLAVOR=PLATFORM_FLAVOR_ID_$(PLATFORM_FLAVOR)
21
22cppflags$(sm)	+= -Icore/include
23cppflags$(sm)	+= -include $(out-dir)/core/include/generated/conf.h
24cppflags$(sm)	+= $(platform-cppflags) $(core-platform-cppflags)
25cflags$(sm)	+= $(platform-cflags) $(core-platform-cflags)
26aflags$(sm)	+= $(platform-aflags) $(core-platform-aflags)
27
28cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL)
29
30cppflags$(sm)	+= -Ilib/libutee/include
31
32# Tell all libraries and sub-directories (included below) that we have a
33# configuration file
34
35conf-file := $(out-dir)/core/include/generated/conf.h
36conf-mk-file := $(out-dir)/core/conf.mk
37$(conf-file): $(conf-mk-file)
38
39cleanfiles += $(conf-file)
40cleanfiles += $(conf-mk-file)
41
42include mk/checkconf.mk
43$(conf-file): FORCE
44	$(call check-conf-h)
45
46$(conf-mk-file):  FORCE
47	$(call check-conf-mk)
48
49#
50# Do libraries
51#
52
53# Set a prefix to avoid conflicts with user TAs that will use the same
54# source but with different flags below
55base-prefix := $(sm)-
56libname = utils
57libdir = lib/libutils
58include mk/lib.mk
59
60libname = mpa
61libdir = lib/libmpa
62include mk/lib.mk
63base-prefix :=
64
65libname = tomcrypt
66libdir = core/lib/libtomcrypt
67include mk/lib.mk
68
69#
70# Do main source
71#
72subdirs = $(core-platform-subdirs) core
73include mk/subdir.mk
74include mk/compile.mk
75include $(platform-dir)/link.mk
76
77
78