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 11# Setup compiler for this sub module 12CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE) 13COMPILER_$(sm) ?= $(COMPILER) 14include mk/$(COMPILER_$(sm)).mk 15 16PLATFORM_FLAVOR ?= default 17platform_$(PLATFORM) := y 18platform_flavor_$(PLATFORM_FLAVOR) := y 19cppflags$(sm) += -DPLATFORM_FLAVOR=PLATFORM_FLAVOR_ID_$(PLATFORM_FLAVOR) 20 21cppflags$(sm) += -Icore/include 22cppflags$(sm) += -include $(out-dir)/core/include/generated/conf.h 23cppflags$(sm) += $(platform-cppflags) $(core-platform-cppflags) 24cflags$(sm) += $(platform-cflags) $(core-platform-cflags) 25aflags$(sm) += $(platform-aflags) $(core-platform-aflags) 26 27# Config flags from mk/config.mk 28cppflags$(sm) += -DCFG_TEE_FW_DEBUG=$(CFG_TEE_FW_DEBUG) 29cppflags$(sm) += -DCFG_TRACE_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 43include mk/checkconf.mk 44$(conf-file): FORCE 45 $(call check-conf-h) 46 47$(conf-mk-file): FORCE 48 $(call build-conf-mk) 49 50# 51# Do libraries 52# 53 54# Set a prefix to avoid conflicts with user TAs that will use the same 55# source but with different flags below 56base-prefix := $(sm)- 57libname = utils 58libdir = lib/libutils 59include mk/lib.mk 60 61libname = mpa 62libdir = lib/libmpa 63include mk/lib.mk 64base-prefix := 65 66libname = tomcrypt 67libdir = core/lib/libtomcrypt 68include mk/lib.mk 69 70# 71# Do main source 72# 73subdirs = $(core-platform-subdirs) core 74include mk/subdir.mk 75include mk/compile.mk 76include $(platform-dir)/link.mk 77 78 79