• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Platform Makefile
3#
4
5include $(CHRE_PREFIX)/external/flatbuffers/flatbuffers.mk
6
7# Common Compiler Flags ########################################################
8
9# Include paths.
10COMMON_CFLAGS += -Iplatform/include
11
12# Common Compiler Flags ########################################################
13
14# Common Source Files ##########################################################
15
16COMMON_SRCS += platform/shared/platform_sensor_util.cc
17
18# SLPI-specific Compiler Flags #################################################
19
20# Include paths.
21SLPI_CFLAGS += -I$(SLPI_PREFIX)/build/ms
22SLPI_CFLAGS += -I$(SLPI_PREFIX)/build/cust
23SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/debugtools
24SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/services
25SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/kernel/devcfg
26SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/kernel/qurt
27SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/dal
28SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/mproc
29SLPI_CFLAGS += -I$(SLPI_PREFIX)/core/api/systemdrivers
30SLPI_CFLAGS += -I$(SLPI_PREFIX)/platform/inc
31SLPI_CFLAGS += -I$(SLPI_PREFIX)/platform/inc/HAP
32SLPI_CFLAGS += -I$(SLPI_PREFIX)/platform/inc/stddef
33SLPI_CFLAGS += -I$(SLPI_PREFIX)/platform/rtld/inc
34
35SLPI_CFLAGS += -Iplatform/shared/include
36SLPI_CFLAGS += -Iplatform/slpi/include
37
38# We use FlatBuffers in the SLPI platform layer
39SLPI_CFLAGS += $(FLATBUFFERS_CFLAGS)
40
41# SLPI/SMGR-specific Compiler Flags ############################################
42
43# Include paths.
44SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/api
45SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/idl/inc
46SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/inc
47SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/smr/inc
48SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/util/mathtools/inc
49SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/goog/api
50SLPI_SMGR_CFLAGS += -I$(SLPI_PREFIX)/Sensors/pm/inc
51
52SLPI_SMGR_CFLAGS += -Iplatform/slpi/smgr/include
53
54SLPI_SMGR_CFLAGS += -DCHRE_SLPI_SMGR
55
56# SLPI/SEE-specific Compiler Flags #############################################
57
58# Include paths.
59SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/chre/chre/src/system/chre/platform/slpi
60SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/core/api/kernel/libstd/stringl
61SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/qmimsgs/common/api
62SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc_api/pb
63SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc/framework/cm/inc
64SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc/goog/api
65SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc/inc
66SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc/inc/internal
67SLPI_SEE_CFLAGS += -I$(SLPI_PREFIX)/ssc/inc/utils/nanopb
68
69SLPI_SEE_CFLAGS += -Iplatform/slpi/see/include
70
71SLPI_SEE_CFLAGS += -DCHRE_SLPI_SEE
72
73# Needed to define __SIZEOF_ATTR_THREAD in sns_osa_thread.h, included in
74# sns_memmgr.h.
75SLPI_SEE_CFLAGS += -DSSC_TARGET_HEXAGON
76
77# Defined in slpi_proc/ssc/build/ssc.scons
78SLPI_SEE_CFLAGS += -DPB_FIELD_16BIT
79
80ifeq ($(IMPORT_CHRE_UTILS), true)
81SLPI_SEE_CFLAGS += -DIMPORT_CHRE_UTILS
82endif
83
84# SLPI-specific Source Files ###################################################
85
86SLPI_SRCS += platform/shared/chre_api_audio.cc
87SLPI_SRCS += platform/shared/chre_api_core.cc
88SLPI_SRCS += platform/shared/chre_api_gnss.cc
89SLPI_SRCS += platform/shared/chre_api_re.cc
90SLPI_SRCS += platform/shared/chre_api_sensor.cc
91SLPI_SRCS += platform/shared/chre_api_version.cc
92SLPI_SRCS += platform/shared/chre_api_wifi.cc
93SLPI_SRCS += platform/shared/chre_api_wwan.cc
94SLPI_SRCS += platform/shared/host_protocol_chre.cc
95SLPI_SRCS += platform/shared/host_protocol_common.cc
96SLPI_SRCS += platform/shared/memory_manager.cc
97SLPI_SRCS += platform/shared/nanoapp/nanoapp_dso_util.cc
98SLPI_SRCS += platform/shared/pal_system_api.cc
99SLPI_SRCS += platform/shared/system_time.cc
100SLPI_SRCS += platform/slpi/chre_api_re.cc
101SLPI_SRCS += platform/slpi/debug_dump.cc
102SLPI_SRCS += platform/slpi/host_link.cc
103SLPI_SRCS += platform/slpi/init.cc
104SLPI_SRCS += platform/slpi/memory.cc
105SLPI_SRCS += platform/slpi/memory_manager.cc
106SLPI_SRCS += platform/slpi/nanoapp_load_manager.cc
107SLPI_SRCS += platform/slpi/platform_nanoapp.cc
108SLPI_SRCS += platform/slpi/platform_pal.cc
109SLPI_SRCS += platform/slpi/system_time.cc
110SLPI_SRCS += platform/slpi/system_time_util.cc
111SLPI_SRCS += platform/slpi/system_timer.cc
112
113# Optional audio support.
114ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
115SLPI_SRCS += platform/slpi/platform_audio.cc
116endif
117
118# Optional GNSS support.
119ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
120SLPI_SRCS += platform/shared/platform_gnss.cc
121endif
122
123# Optional Wi-Fi support.
124ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
125SLPI_SRCS += platform/shared/platform_wifi.cc
126endif
127
128# Optional WWAN support.
129ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
130SLPI_SRCS += platform/shared/platform_wwan.cc
131endif
132
133# SLPI/SMGR-specific Source Files ##############################################
134
135SLPI_SMGR_SRCS += platform/slpi/smgr/platform_sensor.cc
136SLPI_SMGR_SRCS += platform/slpi/smgr/platform_sensor_util.cc
137SLPI_SMGR_SRCS += platform/slpi/smgr/power_control_manager.cc
138SLPI_SMGR_SRCS += platform/slpi/smgr/smr_helper.cc
139
140# SLPI/SEE-specific Source Files ###############################################
141
142SLPI_SEE_SRCS += platform/slpi/see/platform_sensor.cc
143SLPI_SEE_SRCS += platform/slpi/see/power_control_manager.cc
144
145ifneq ($(IMPORT_CHRE_UTILS), true)
146SLPI_SEE_SRCS += platform/slpi/see/island_vote_client.cc
147SLPI_SEE_SRCS += platform/slpi/see/see_cal_helper.cc
148SLPI_SEE_SRCS += platform/slpi/see/see_helper.cc
149endif
150
151SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_client.pb.c
152SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_suid.pb.c
153SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_cal.pb.c
154SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_physical_sensor_test.pb.c
155SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_proximity.pb.c
156SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_remote_proc_state.pb.c
157SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_resampler.pb.c
158SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_std.pb.c
159SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_std_sensor.pb.c
160SLPI_SEE_SRCS += $(SLPI_PREFIX)/ssc_api/pb/sns_std_type.pb.c
161
162SLPI_SEE_QSK_SRCS += $(SLPI_PREFIX)/chre/chre/src/system/chre/platform/slpi/sns_qmi_client_alt.c
163SLPI_SEE_QMI_SRCS += $(SLPI_PREFIX)/chre/chre/src/system/chre/platform/slpi/sns_qmi_client.c
164
165# Simulator-specific Compiler Flags ############################################
166
167SIM_CFLAGS += -Iplatform/shared/include
168
169# Simulator-specific Source Files ##############################################
170
171SIM_SRCS += platform/linux/chre_api_re.cc
172SIM_SRCS += platform/linux/context.cc
173SIM_SRCS += platform/linux/fatal_error.cc
174SIM_SRCS += platform/linux/host_link.cc
175SIM_SRCS += platform/linux/memory.cc
176SIM_SRCS += platform/linux/memory_manager.cc
177SIM_SRCS += platform/linux/platform_log.cc
178SIM_SRCS += platform/linux/platform_pal.cc
179SIM_SRCS += platform/linux/power_control_manager.cc
180SIM_SRCS += platform/linux/system_time.cc
181SIM_SRCS += platform/linux/system_timer.cc
182SIM_SRCS += platform/linux/platform_nanoapp.cc
183SIM_SRCS += platform/linux/platform_sensor.cc
184SIM_SRCS += platform/shared/chre_api_audio.cc
185SIM_SRCS += platform/shared/chre_api_core.cc
186SIM_SRCS += platform/shared/chre_api_gnss.cc
187SIM_SRCS += platform/shared/chre_api_re.cc
188SIM_SRCS += platform/shared/chre_api_sensor.cc
189SIM_SRCS += platform/shared/chre_api_version.cc
190SIM_SRCS += platform/shared/chre_api_wifi.cc
191SIM_SRCS += platform/shared/chre_api_wwan.cc
192SIM_SRCS += platform/shared/memory_manager.cc
193SIM_SRCS += platform/shared/nanoapp/nanoapp_dso_util.cc
194SIM_SRCS += platform/shared/pal_system_api.cc
195SIM_SRCS += platform/shared/system_time.cc
196
197# Optional GNSS support.
198ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
199SIM_SRCS += platform/shared/pal_gnss_stub.cc
200SIM_SRCS += platform/shared/platform_gnss.cc
201endif
202
203# Optional Wi-Fi support.
204ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
205SIM_SRCS += platform/shared/pal_wifi_stub.cc
206SIM_SRCS += platform/shared/platform_wifi.cc
207endif
208
209# Optional WWAN support.
210ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
211SIM_SRCS += platform/shared/pal_wwan_stub.cc
212SIM_SRCS += platform/shared/platform_wwan.cc
213endif
214
215# Linux-specific Compiler Flags ################################################
216
217GOOGLE_X86_LINUX_CFLAGS += -Iplatform/linux/include
218
219# Linux-specific Source Files ##################################################
220
221GOOGLE_X86_LINUX_SRCS += platform/linux/init.cc
222
223# Optional audio support.
224ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
225GOOGLE_X86_LINUX_SRCS += platform/linux/audio_source.cc
226GOOGLE_X86_LINUX_SRCS += platform/linux/platform_audio.cc
227endif
228
229# Android-specific Compiler Flags ##############################################
230
231# Add the Android include search path for Android-specific header files.
232GOOGLE_ARM64_ANDROID_CFLAGS += -Iplatform/android/include
233
234# Add in host sources to allow the executable to both be a socket server and
235# CHRE implementation.
236GOOGLE_ARM64_ANDROID_CFLAGS += -I$(ANDROID_BUILD_TOP)/system/core/base/include
237GOOGLE_ARM64_ANDROID_CFLAGS += -I$(ANDROID_BUILD_TOP)/system/core/libcutils/include
238GOOGLE_ARM64_ANDROID_CFLAGS += -I$(ANDROID_BUILD_TOP)/system/core/libutils/include
239GOOGLE_ARM64_ANDROID_CFLAGS += -I$(ANDROID_BUILD_TOP)/system/core/liblog/include
240GOOGLE_ARM64_ANDROID_CFLAGS += -Ihost/common/include
241
242# Also add the linux sources to fall back to the default Linux implementation.
243GOOGLE_ARM64_ANDROID_CFLAGS += -Iplatform/linux/include
244
245# We use FlatBuffers in the Android simulator
246GOOGLE_ARM64_ANDROID_CFLAGS += -I$(FLATBUFFERS_PATH)/include
247
248# Android-specific Source Files ################################################
249
250ANDROID_CUTILS_TOP = $(ANDROID_BUILD_TOP)/system/core/libcutils
251ANDROID_LOG_TOP = $(ANDROID_BUILD_TOP)/system/core/liblog
252
253GOOGLE_ARM64_ANDROID_SRCS += $(ANDROID_CUTILS_TOP)/sockets_unix.cpp
254GOOGLE_ARM64_ANDROID_SRCS += $(ANDROID_CUTILS_TOP)/android_get_control_file.cpp
255GOOGLE_ARM64_ANDROID_SRCS += $(ANDROID_CUTILS_TOP)/socket_local_server_unix.cpp
256GOOGLE_ARM64_ANDROID_SRCS += $(ANDROID_CUTILS_TOP)/socket_local_client_unix.cpp
257GOOGLE_ARM64_ANDROID_SRCS += $(ANDROID_LOG_TOP)/logd_reader.c
258
259GOOGLE_ARM64_ANDROID_SRCS += platform/android/init.cc
260GOOGLE_ARM64_ANDROID_SRCS += platform/android/host_link.cc
261GOOGLE_ARM64_ANDROID_SRCS += platform/shared/host_protocol_common.cc
262GOOGLE_ARM64_ANDROID_SRCS += host/common/host_protocol_host.cc
263GOOGLE_ARM64_ANDROID_SRCS += host/common/socket_server.cc
264
265# Optional audio support.
266ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
267GOOGLE_ARM64_ANDROID_SRCS += platform/android/platform_audio.cc
268endif
269
270# GoogleTest Compiler Flags ####################################################
271
272# The order here is important so that the googletest target prefers shared,
273# linux and then SLPI.
274GOOGLETEST_CFLAGS += -Iplatform/shared/include
275GOOGLETEST_CFLAGS += -Iplatform/linux/include
276GOOGLETEST_CFLAGS += -Iplatform/slpi/include
277
278# GoogleTest Source Files ######################################################
279
280GOOGLETEST_SRCS += platform/linux/assert.cc
281GOOGLETEST_SRCS += platform/linux/audio_source.cc
282GOOGLETEST_SRCS += platform/linux/platform_audio.cc
283GOOGLETEST_SRCS += platform/slpi/smgr/platform_sensor_util.cc
284GOOGLETEST_SRCS += platform/slpi/smgr/tests/platform_sensor_util_test.cc
285