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