1include mk/cleanvars.mk 2 3# Set current submodule (used for module specific flags compile result etc) 4sm := ldelf 5sm-$(sm) := y 6 7link-out-dir$(sm) := $(out-dir)/$(sm) 8 9cppflags$(sm) := $(core-platform-cppflags) 10cflags$(sm) := $(core-platform-cflags) -fpie -fvisibility=hidden 11aflags$(sm) := $(core-platform-aflags) 12 13# ldelf is compiled for the same arch or register width as core 14ifeq ($(CFG_ARM64_core),y) 15CFG_ARM64_$(sm) := y 16endif 17ifeq ($(CFG_ARM32_core),y) 18CFG_ARM32_$(sm) := y 19endif 20ifeq ($(CFG_RV64_core),y) 21CFG_RV64_$(sm) := y 22endif 23ifeq ($(CFG_RV32_core),y) 24CFG_RV32_$(sm) := y 25endif 26arch-bits-$(sm) := $(arch-bits-core) 27 28cppflags$(sm) += -include $(conf-file) 29cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) 30cppflags$(sm) += -D__LDELF__ 31 32ifeq ($(CFG_CORE_SANITIZE_UNDEFINED),y) 33cflags$(sm) += -fsanitize=undefined 34endif 35 36# Use same compiler as for core 37CROSS_COMPILE_$(sm) := $(CROSS_COMPILE_core) 38COMPILER_$(sm) := $(COMPILER_core) 39include mk/$(COMPILER_$(sm)).mk 40 41base-prefix := $(sm)- 42 43libname = utils 44libdir = lib/libutils 45include mk/lib.mk 46 47libname = utee 48libdir = lib/libutee 49include mk/lib.mk 50 51libname = unw 52libdir = lib/libunw 53include mk/lib.mk 54 55base-prefix := 56 57subdirs = ldelf 58include mk/subdir.mk 59 60include mk/compile.mk 61 62include ldelf/link.mk 63