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 mk/checkconf.mk 10include $(platform-dir)/conf.mk 11include core/arch/$(ARCH)/$(ARCH).mk 12 13# Setup compiler for this sub module 14CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE) 15COMPILER_$(sm) ?= $(COMPILER) 16include mk/$(COMPILER_$(sm)).mk 17 18PLATFORM_FLAVOR ?= default 19platform_$(PLATFORM) := y 20platform_flavor_$(PLATFORM_FLAVOR) := y 21cppflags$(sm) += -DPLATFORM_FLAVOR=PLATFORM_FLAVOR_ID_$(PLATFORM_FLAVOR) 22 23cppflags$(sm) += -Icore/include 24cppflags$(sm) += -include $(out-dir)/core/include/generated/conf.h 25cppflags$(sm) += $(platform-cppflags) $(core-platform-cppflags) 26cflags$(sm) += $(platform-cflags) $(core-platform-cflags) 27aflags$(sm) += $(platform-aflags) $(core-platform-aflags) 28 29cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) 30 31cppflags$(sm) += -Ilib/libutee/include 32 33# Tell all libraries and sub-directories (included below) that we have a 34# configuration file 35 36conf-file := $(out-dir)/core/include/generated/conf.h 37conf-mk-file := $(out-dir)/core/conf.mk 38$(conf-file): $(conf-mk-file) 39 40cleanfiles += $(conf-file) 41cleanfiles += $(conf-mk-file) 42 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# 72 73subdirs = $(core-platform-subdirs) core 74include mk/subdir.mk 75 76# Generate C file to embed public key for TA verification 77gen-srcs += core/ta_pub_key.c 78$(out-dir)/core/ta_pub_key.c: $(TA_SIGN_KEY) 79 @$(cmd-echo-silent) ' GEN $@' 80 @$(q)scripts/pem_to_pub_c.py --prefix ta_pub_key --key $< --out $@ 81 82include mk/compile.mk 83include $(platform-dir)/link.mk 84 85 86