forked from OP-TEE/optee_os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.mk
85 lines (63 loc) · 2.03 KB
/
core.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
include mk/cleanvars.mk
# Set current submodule (used for module specific flags compile result etc)
sm := core
sm-$(sm) := y
arch-dir := core/arch/$(ARCH)
platform-dir := $(arch-dir)/plat-$(PLATFORM)
include $(platform-dir)/conf.mk
include core/arch/$(ARCH)/$(ARCH).mk
# Setup compiler for this sub module
CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE)
COMPILER_$(sm) ?= $(COMPILER)
include mk/$(COMPILER_$(sm)).mk
PLATFORM_FLAVOR ?= default
platform_$(PLATFORM) := y
platform_flavor_$(PLATFORM_FLAVOR) := y
cppflags$(sm) += -DPLATFORM_FLAVOR=PLATFORM_FLAVOR_ID_$(PLATFORM_FLAVOR)
cppflags$(sm) += -Icore/include
cppflags$(sm) += -include $(out-dir)/core/include/generated/conf.h
cppflags$(sm) += $(platform-cppflags) $(core-platform-cppflags)
cflags$(sm) += $(platform-cflags) $(core-platform-cflags)
aflags$(sm) += $(platform-aflags) $(core-platform-aflags)
cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL)
cppflags$(sm) += -Ilib/libutee/include
# Tell all libraries and sub-directories (included below) that we have a
# configuration file
conf-file := $(out-dir)/core/include/generated/conf.h
conf-mk-file := $(out-dir)/core/conf.mk
$(conf-file): $(conf-mk-file)
cleanfiles += $(conf-file)
cleanfiles += $(conf-mk-file)
include mk/checkconf.mk
$(conf-file): FORCE
$(call check-conf-h)
$(conf-mk-file): FORCE
$(call check-conf-mk)
#
# Do libraries
#
# Set a prefix to avoid conflicts with user TAs that will use the same
# source but with different flags below
base-prefix := $(sm)-
libname = utils
libdir = lib/libutils
include mk/lib.mk
libname = mpa
libdir = lib/libmpa
include mk/lib.mk
base-prefix :=
libname = tomcrypt
libdir = core/lib/libtomcrypt
include mk/lib.mk
#
# Do main source
#
subdirs = $(core-platform-subdirs) core
include mk/subdir.mk
# Generate C file to embed public key for TA verification
gen-srcs += core/ta_pub_key.c
$(out-dir)/core/ta_pub_key.c: $(TA_SIGN_KEY)
@$(cmd-echo-silent) ' GEN $@'
@$(q)scripts/pem_to_pub_c.py --prefix ta_pub_key --key $< --out $@
include mk/compile.mk
include $(platform-dir)/link.mk