1*84e33947SAndroid Build Coastguard Workerinclude $(CHRE_PREFIX)/build/clean_build_template_args.mk 2*84e33947SAndroid Build Coastguard Worker 3*84e33947SAndroid Build Coastguard WorkerTARGET_NAME = aosp_cm4_exynos-embos 4*84e33947SAndroid Build Coastguard Workerifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),) 5*84e33947SAndroid Build Coastguard Worker 6*84e33947SAndroid Build Coastguard Workerifeq ($(RAINBOW_SDK_DIR),) 7*84e33947SAndroid Build Coastguard Worker$(error "The Rainbow SDK directory needs to be exported as the RAINBOW_SDK_DIR \ 8*84e33947SAndroid Build Coastguard Worker environment variable") 9*84e33947SAndroid Build Coastguard Workerendif 10*84e33947SAndroid Build Coastguard Worker 11*84e33947SAndroid Build Coastguard WorkerEMBOS_V422_INCLUDE_DIR := $(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/embos/Start/Inc/Embos422 12*84e33947SAndroid Build Coastguard Worker 13*84e33947SAndroid Build Coastguard WorkerCORTEXM_ARCH := m4_hardfp 14*84e33947SAndroid Build Coastguard Worker 15*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(EMBOS_V422_INCLUDE_DIR) 16*84e33947SAndroid Build Coastguard Worker 17*84e33947SAndroid Build Coastguard Worker# Sized based on the buffer allocated in the host daemon (4096 bytes), minus 18*84e33947SAndroid Build Coastguard Worker# FlatBuffer overhead (max 88 bytes), minus some extra space to make a nice 19*84e33947SAndroid Build Coastguard Worker# round number and allow for addition of new fields to the FlatBuffer 20*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=4000 21*84e33947SAndroid Build Coastguard Worker 22*84e33947SAndroid Build Coastguard Worker# Used to expose libc headers to nanoapps that aren't supported on the given platform 23*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(CHRE_PREFIX)/platform/shared/include/chre/platform/shared/libc 24*84e33947SAndroid Build Coastguard Worker 25*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += $(ARM_CFLAGS) 26*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += $(EMBOS_CFLAGS) 27*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += $(EXYNOS_CFLAGS) 28*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/firmware/os/platform/exynos/inc 29*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/firmware/os/platform/exynos/inc/plat 30*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/firmware/os/platform/exynos/inc/plat/cmsis 31*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/firmware/os/platform/exynos/inc/plat/csp 32*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/firmware/os/platform/exynos/inc/plat/mailbox 33*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -I$(RAINBOW_SDK_DIR)/OEM/LSI/exynos9925/embos/Project/erd9925/DeviceSupport 34*84e33947SAndroid Build Coastguard Worker 35*84e33947SAndroid Build Coastguard Worker# TODO(b/242765122): The target won't build out of the box until the 36*84e33947SAndroid Build Coastguard Worker# aforementioned bug is resolved since a set of standard library headers 37*84e33947SAndroid Build Coastguard Worker# that CHRE requires are missing. Please contact the CHRE team for a 38*84e33947SAndroid Build Coastguard Worker# workaround. 39*84e33947SAndroid Build Coastguard Worker 40*84e33947SAndroid Build Coastguard Worker# IAR interlinking compatibility flags 41*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -D__ARM7EM__ 42*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -D__CORE__=__ARM7EM__ 43*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -D__FPU_PRESENT=1 44*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -D_LIBCPP_HAS_THREAD_API_EXTERNAL 45*84e33947SAndroid Build Coastguard WorkerGCC_SO_LDFLAGS += --no-wchar-size-warning 46*84e33947SAndroid Build Coastguard Worker 47*84e33947SAndroid Build Coastguard Worker# The Exynos lib has a macro that includes common headers based on a 'Chip' ID. Eg: 48*84e33947SAndroid Build Coastguard Worker# CSP_HEADER(csp_common) includes csp_common{CHIP}.h. 49*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -DCHIP=9925 50*84e33947SAndroid Build Coastguard Worker 51*84e33947SAndroid Build Coastguard Worker# There are quite a few macros gated by 'EMBOS' in the csp library. 52*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -DEMBOS 53*84e33947SAndroid Build Coastguard Worker 54*84e33947SAndroid Build Coastguard Worker# CMSIS uses the register keyword liberally, which results in a warning when 55*84e33947SAndroid Build Coastguard Worker# compiled with GCC. 56*84e33947SAndroid Build Coastguard WorkerCOMMON_CXX_CFLAGS += -Wno-register 57*84e33947SAndroid Build Coastguard Worker 58*84e33947SAndroid Build Coastguard Worker# Temporarily need the following define, since we use printfs for logging 59*84e33947SAndroid Build Coastguard Worker# until the logcat redirection is implemented. 60*84e33947SAndroid Build Coastguard Worker# Reference: https://en.cppreference.com/w/cpp/types/integer#Notes 61*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -D__int64_t_defined 62*84e33947SAndroid Build Coastguard Worker 63*84e33947SAndroid Build Coastguard Worker# Temporarily disable implicit double promotion warnings until logcat 64*84e33947SAndroid Build Coastguard Worker# redirection is implemented. 65*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -Wno-double-promotion 66*84e33947SAndroid Build Coastguard Worker 67*84e33947SAndroid Build Coastguard Worker# GCC is unnecessarily strict with shadow warnings in legal C++ constructor 68*84e33947SAndroid Build Coastguard Worker# syntax. 69*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -Wno-shadow 70*84e33947SAndroid Build Coastguard Worker 71*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += -DCHRE_FIRST_SUPPORTED_API_VERSION=CHRE_API_VERSION_1_6 72*84e33947SAndroid Build Coastguard Worker 73*84e33947SAndroid Build Coastguard WorkerTARGET_VARIANT_SRCS += $(EMBOS_SRCS) 74*84e33947SAndroid Build Coastguard WorkerTARGET_VARIANT_SRCS += $(EXYNOS_SRCS) 75*84e33947SAndroid Build Coastguard WorkerTARGET_VARIANT_SRCS += $(ARM_SRCS) 76*84e33947SAndroid Build Coastguard WorkerTARGET_VARIANT_SRCS += $(DSO_SUPPORT_LIB_SRCS) 77*84e33947SAndroid Build Coastguard Worker 78*84e33947SAndroid Build Coastguard WorkerTARGET_CFLAGS += $(DSO_SUPPORT_LIB_CFLAGS) 79*84e33947SAndroid Build Coastguard Worker 80*84e33947SAndroid Build Coastguard WorkerTARGET_PLATFORM_ID = 0x476F6F676C002000 81*84e33947SAndroid Build Coastguard Worker 82*84e33947SAndroid Build Coastguard Workerinclude $(CHRE_PREFIX)/build/arch/cortexm.mk 83*84e33947SAndroid Build Coastguard Workerinclude $(CHRE_PREFIX)/build/build_template.mk 84*84e33947SAndroid Build Coastguard Workerendif 85