blob: 7a9f972286fef6916a3c7c77a200461ad8f18383 [file] [log] [blame]
Andrew Rossignol0d6761f2016-12-19 14:51:00 -08001#
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -08002# CHRE Makefile
Andrew Rossignol0d6761f2016-12-19 14:51:00 -08003#
4
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -08005# 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
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080011# Build Configuration ##########################################################
12
13OUTPUT_NAME = libchre
14
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080015# Compiler Flags ###############################################################
16
Andrew Rossignola16406b2017-03-15 18:29:17 -070017# Symbols required by the runtime for conditional compilation.
18COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
19COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
20COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
21
Andrew Rossignole969b9b2017-03-16 14:26:09 -070022# Place nanoapps in a namespace.
23COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
24
Andrew Rossignol993e0262017-10-10 16:10:43 -070025# Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
26# Linux.
27CHRE_HOST_OS := $(shell uname)
28
Brian Duddieee0b9db2017-05-19 16:14:02 -070029ifeq ($(CHRE_PATCH_VERSION),)
Andrew Rossignol993e0262017-10-10 16:10:43 -070030ifeq ($(CHRE_HOST_OS),Darwin)
31DATE_CMD=gdate
32else
33DATE_CMD=date
34endif
35
Brian Duddieee0b9db2017-05-19 16:14:02 -070036# Compute the patch version as the number of hours since the start of some
37# arbitrary epoch. This will roll over 16 bits after ~7 years, but patch version
38# is scoped to the API version, so we can adjust the offset when a new API
39# version is released.
Andrew Rossignol993e0262017-10-10 16:10:43 -070040EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
41CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
Brian Duddieee0b9db2017-05-19 16:14:02 -070042endif
43
44COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
45
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080046# Makefile Includes ############################################################
47
Andrew Rossignolea139892017-04-05 12:57:15 -070048# Variant-specific includes.
49include $(CHRE_VARIANT_MK_INCLUDES)
50
51# CHRE Implementation includes.
Andrew Rossignole969b9b2017-03-16 14:26:09 -070052include apps/apps.mk
Meng-hsuan Chungc6ef3f62017-03-22 13:49:03 -070053include ash/ash.mk
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080054include chre_api/chre_api.mk
55include core/core.mk
Andrew Rossignol388d81b2017-02-28 17:12:58 -080056include external/external.mk
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080057include pal/pal.mk
58include platform/platform.mk
59include util/util.mk
60
Andrew Rossignolea139892017-04-05 12:57:15 -070061# Common includes.
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080062include build/common.mk
63
64# Supported Variants Includes. Not all CHRE variants are supported by this
65# implementation of CHRE. Example: this CHRE implementation is never built for
66# google_cm4_nanohub as Nanohub itself is a CHRE implementation.
Andrew Rossignol27126372017-02-23 11:50:18 -080067include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
68include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
Andrew Rossignole7d3b362017-08-08 14:39:00 -070069include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
Meng-hsuan Chung6db8da02017-09-29 19:52:38 -070070include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
Andrew Rossignold67589d2017-02-24 11:09:35 -080071include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
Andrew Rossignol388d81b2017-02-28 17:12:58 -080072include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk