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