• 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_ENABLE_DEBUG_DUMP
25COMMON_CFLAGS += -DCHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
26
27ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
28COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
29else
30COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED
31endif
32
33# Place nanoapps in a namespace.
34COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
35
36# Optional audio support.
37ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
38COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED
39endif
40
41# Optional GNSS support.
42ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
43COMMON_CFLAGS += -DCHRE_GNSS_SUPPORT_ENABLED
44endif
45
46# Optional Wi-Fi support.
47ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
48COMMON_CFLAGS += -DCHRE_WIFI_SUPPORT_ENABLED
49endif
50
51# Optional WWAN support.
52ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
53COMMON_CFLAGS += -DCHRE_WWAN_SUPPORT_ENABLED
54endif
55
56# Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
57# Linux.
58CHRE_HOST_OS := $(shell uname)
59
60ifeq ($(CHRE_PATCH_VERSION),)
61ifeq ($(CHRE_HOST_OS),Darwin)
62DATE_CMD=gdate
63else
64DATE_CMD=date
65endif
66
67# Compute the patch version as the number of hours since the start of some
68# arbitrary epoch. This will roll over 16 bits after ~7 years, but patch version
69# is scoped to the API version, so we can adjust the offset when a new API
70# version is released.
71EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
72CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
73endif
74
75COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
76
77# Makefile Includes ############################################################
78
79# Common includes.
80include $(CHRE_PREFIX)/build/defs.mk
81include $(CHRE_PREFIX)/build/common.mk
82
83# CHRE Implementation includes.
84include $(CHRE_PREFIX)/apps/apps.mk
85include $(CHRE_PREFIX)/ash/ash.mk
86include $(CHRE_PREFIX)/chre_api/chre_api.mk
87include $(CHRE_PREFIX)/core/core.mk
88include $(CHRE_PREFIX)/external/external.mk
89include $(CHRE_PREFIX)/pal/pal.mk
90include $(CHRE_PREFIX)/platform/platform.mk
91include $(CHRE_PREFIX)/util/util.mk
92
93# Supported Variants Includes. Not all CHRE variants are supported by this
94# implementation of CHRE. Example: this CHRE implementation is never built for
95# google_cm4_nanohub as Nanohub itself is a CHRE implementation.
96include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
97include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
98include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
99include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
100include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
101include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk
102include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk
103include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
104include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
105include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see.mk
106include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see-uimg.mk
107include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
108include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk
109