xref: /optee_os/core/core.mk (revision 7018ae01e522c809936b3f4df22c0018605b9fb1)
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
10
11PLATFORM_FLAVOR ?= default
12platform_$(PLATFORM) := y
13platform_flavor_$(PLATFORM_FLAVOR) := y
14cppflags$(sm)	+= -DPLATFORM_FLAVOR=PLATFORM_FLAVOR_ID_$(PLATFORM_FLAVOR)
15
16cppflags$(sm)	+= -Icore/include
17cppflags$(sm)	+= -include $(out-dir)/core/include/generated/conf.h
18cppflags$(sm)	+= $(platform-cppflags) $(core-platform-cppflags)
19cflags$(sm)	+= $(platform-cflags) $(core-platform-cflags)
20aflags$(sm)	+= $(platform-aflags) $(core-platform-aflags)
21
22# Config flags from mk/config.mk
23cppflags$(sm) += -DCFG_TEE_FW_DEBUG=$(CFG_TEE_FW_DEBUG)
24cppflags$(sm) += -DCFG_TRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL)
25
26cppflags$(sm)	+= -Ilib/libutee/include
27
28# Tell all libraries and sub-directories (included below) that we have a
29# configuration file
30
31conf-file := $(out-dir)/core/include/generated/conf.h
32conf-mk-file := $(out-dir)/core/conf.mk
33$(conf-file): $(conf-mk-file)
34
35cleanfiles += $(conf-file)
36cleanfiles += $(conf-mk-file)
37
38include mk/checkconf.mk
39$(conf-file): FORCE
40	$(call check-conf-h)
41
42$(conf-mk-file):  FORCE
43	$(call build-conf-mk)
44
45#
46# Do libraries
47#
48
49# Set a prefix to avoid conflicts with user TAs that will use the same
50# source but with different flags below
51base-prefix := $(sm)-
52libname = utils
53libdir = lib/libutils
54include mk/lib.mk
55
56libname = mpa
57libdir = lib/libmpa
58include mk/lib.mk
59base-prefix :=
60
61libname = tomcrypt
62libdir = core/lib/libtomcrypt
63include mk/lib.mk
64
65#
66# Do main source
67#
68subdirs = $(core-platform-subdirs) core
69include mk/subdir.mk
70include mk/compile.mk
71include $(platform-dir)/link.mk
72
73
74