1#
2# CHRE Makefile
3#
4
5# Environment Setup ############################################################
6
7# Building CHRE is always done in-tree so the CHRE_PREFIX can be assigned to the
8# current directory.
9CHRE_PREFIX = .
10
11# Environment Checks ###########################################################
12
13# Ensure that the user has specified a path to the Hexagon SDK and SLPI tree
14# which are required build the runtime.
15ifeq ($(HEXAGON_SDK_PREFIX),)
16$(error "You must supply a HEXAGON_SDK_PREFIX environment variable \
17         containing a path to the hexagon SDK. Example: \
18         export HEXAGON_SDK_PREFIX=$$HOME/Qualcomm/Hexagon_SDK/3.0")
19endif
20
21ifeq ($(SLPI_PREFIX),)
22$(error "You must supply an SLPI_PREFIX environment variable \
23         containing a path to the SLPI source tree. Example: \
24         export SLPI_PREFIX=$$HOME/slpi_proc")
25endif
26
27# Build Configuration ##########################################################
28
29OUTPUT_NAME = libchre
30
31# Include Paths ################################################################
32
33# Hexagon Include Paths
34HEXAGON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/incs
35HEXAGON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/incs/stddef
36HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/build/ms
37HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/build/cust
38HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/services
39HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/kernel/devcfg
40HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/kernel/qurt
41HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/dal
42HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/mproc
43HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/core/api/systemdrivers
44HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/platform/rtld/inc
45HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/Sensors/api
46HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/idl/inc
47HEXAGON_CFLAGS += -I$(SLPI_PREFIX)/Sensors/common/util/mathtools/inc
48
49# Compiler Flags ###############################################################
50
51# Symbols required by the runtime for conditional compilation.
52COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
53COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
54COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
55
56# Place nanoapps in a namespace.
57COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
58
59# Define CUST_H to allow including the customer header file.
60HEXAGON_CFLAGS += -DCUST_H
61
62# Makefile Includes ############################################################
63
64include apps/apps.mk
65include apps/gnss_world/gnss_world.mk
66include apps/hello_world/hello_world.mk
67include apps/imu_cal/imu_cal.mk
68include apps/message_world/message_world.mk
69include apps/sensor_world/sensor_world.mk
70include apps/timer_world/timer_world.mk
71include apps/wifi_world/wifi_world.mk
72include apps/wwan_world/wwan_world.mk
73include chre_api/chre_api.mk
74include core/core.mk
75include external/external.mk
76include pal/pal.mk
77include platform/platform.mk
78include util/util.mk
79
80# Common Includes
81include build/common.mk
82
83# Supported Variants Includes. Not all CHRE variants are supported by this
84# implementation of CHRE. Example: this CHRE implementation is never built for
85# google_cm4_nanohub as Nanohub itself is a CHRE implementation.
86include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
87include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
88include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
89include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk
90