• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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# Variant Configuration ########################################################
12
13include $(CHRE_VARIANT_MK_INCLUDES)
14
15# Build Configuration ##########################################################
16
17OUTPUT_NAME = libchre
18
19# Compiler Flags ###############################################################
20
21# Symbols required by the runtime for conditional compilation.
22COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
23COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
24COMMON_CFLAGS += -DCHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
25
26ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
27COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
28else
29COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED
30endif
31
32# Place nanoapps in a namespace.
33COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
34
35# Optional audio support.
36ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
37COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED
38endif
39
40# Optional BLE support
41ifeq ($(CHRE_BLE_SUPPORT_ENABLED), true)
42COMMON_CFLAGS += -DCHRE_BLE_SUPPORT_ENABLED
43endif
44
45# Optional GNSS support.
46ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
47COMMON_CFLAGS += -DCHRE_GNSS_SUPPORT_ENABLED
48endif
49
50# Optional sensors support.
51ifeq ($(CHRE_SENSORS_SUPPORT_ENABLED), true)
52COMMON_CFLAGS += -DCHRE_SENSORS_SUPPORT_ENABLED
53endif
54
55# Optional Wi-Fi support.
56ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
57COMMON_CFLAGS += -DCHRE_WIFI_SUPPORT_ENABLED
58endif
59
60# Optional WWAN support.
61ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
62COMMON_CFLAGS += -DCHRE_WWAN_SUPPORT_ENABLED
63endif
64
65# Optional tokenized logging support.
66ifeq ($(CHRE_TOKENIZED_LOGGING_ENABLED), true)
67COMMON_CFLAGS += -DCHRE_TOKENIZED_LOGGING_ENABLED
68include $(CHRE_PREFIX)/external/pigweed/pw_tokenizer.mk
69endif
70
71# Optional nanoapp tokenized logging support.
72ifeq ($(CHRE_NANOAPP_TOKENIZED_LOGGING_SUPPORT_ENABLED), true)
73COMMON_CFLAGS += -DCHRE_NANOAPP_TOKENIZED_LOGGING_SUPPORT_ENABLED
74include $(CHRE_PREFIX)/external/pigweed/pw_tokenizer.mk
75endif
76
77# Optional tokenized tracing support.
78ifeq ($(CHRE_TRACING_ENABLED), true)
79COMMON_CFLAGS += -DCHRE_TRACING_ENABLED
80include $(CHRE_PREFIX)/external/pigweed/pw_trace.mk
81endif
82
83# Optional on-device unit tests support
84include $(CHRE_PREFIX)/test/test.mk
85
86# Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
87# Linux.
88CHRE_HOST_OS := $(shell uname)
89
90ifeq ($(CHRE_PATCH_VERSION),)
91ifeq ($(CHRE_HOST_OS),Darwin)
92DATE_CMD=gdate
93else
94DATE_CMD=date
95endif
96
97# Compute the patch version as the number of hours since the start of some
98# arbitrary epoch. This will roll over 16 bits after ~7 years, but patch version
99# is scoped to the API version, so we can adjust the offset when a new API
100# version is released.
101EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
102CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
103endif
104
105COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
106
107# Makefile Includes ############################################################
108
109# Common includes.
110include $(CHRE_PREFIX)/build/defs.mk
111include $(CHRE_PREFIX)/build/common.mk
112
113# CHRE Implementation includes.
114include $(CHRE_PREFIX)/apps/apps.mk
115include $(CHRE_PREFIX)/chre_api/chre_api.mk
116include $(CHRE_PREFIX)/core/core.mk
117include $(CHRE_PREFIX)/external/external.mk
118include $(CHRE_PREFIX)/pal/pal.mk
119include $(CHRE_PREFIX)/platform/platform.mk
120include $(CHRE_PREFIX)/util/util.mk
121
122# Supported variants includes.
123ifneq ($(CHRE_TARGET_EXTENSION),)
124include $(CHRE_TARGET_EXTENSION)
125endif
126include $(CHRE_PREFIX)/build/variant/aosp_cm4_exynos-embos.mk
127include $(CHRE_PREFIX)/build/variant/aosp_riscv55e03_tinysys.mk
128include $(CHRE_PREFIX)/build/variant/aosp_riscv55e300_tinysys.mk
129include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
130include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
131include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
132include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk
133include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk
134include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
135include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
136include $(CHRE_PREFIX)/build/variant/google_hexagonv66_adsp-see.mk
137include $(CHRE_PREFIX)/build/variant/google_hexagonv66_adsp-see-uimg.mk
138include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see.mk
139include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see-uimg.mk
140include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-qsh.mk
141include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
142include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk
143