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 28# Config flags from mk/config.mk 29cppflags$(sm) += -DCFG_TEE_FW_DEBUG=$(CFG_TEE_FW_DEBUG) 30cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) 31 32cppflags$(sm) += -Ilib/libutee/include 33 34# Tell all libraries and sub-directories (included below) that we have a 35# configuration file 36 37conf-file := $(out-dir)/core/include/generated/conf.h 38conf-mk-file := $(out-dir)/core/conf.mk 39$(conf-file): $(conf-mk-file) 40 41cleanfiles += $(conf-file) 42cleanfiles += $(conf-mk-file) 43 44include mk/checkconf.mk 45$(conf-file): FORCE 46 $(call check-conf-h) 47 48$(conf-mk-file): FORCE 49 $(call build-conf-mk) 50 51# 52# Do libraries 53# 54 55# Set a prefix to avoid conflicts with user TAs that will use the same 56# source but with different flags below 57base-prefix := $(sm)- 58libname = utils 59libdir = lib/libutils 60include mk/lib.mk 61 62libname = mpa 63libdir = lib/libmpa 64include mk/lib.mk 65base-prefix := 66 67libname = tomcrypt 68libdir = core/lib/libtomcrypt 69include mk/lib.mk 70 71# 72# Do main source 73# 74subdirs = $(core-platform-subdirs) core 75include mk/subdir.mk 76include mk/compile.mk 77include $(platform-dir)/link.mk 78 79 80