blob: fc24e675b78a2b78568ef83d171e21987d0fb99e [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 Rossignol816ef892017-10-17 17:40:05 -070011# Variant Configuration ########################################################
12
13include $(CHRE_VARIANT_MK_INCLUDES)
14
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080015# Build Configuration ##########################################################
16
17OUTPUT_NAME = libchre
18
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080019# Compiler Flags ###############################################################
20
Andrew Rossignola16406b2017-03-15 18:29:17 -070021# 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
Andrew Rossignol2f489872018-04-27 13:16:35 -070024
25ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
Andrew Rossignola16406b2017-03-15 18:29:17 -070026COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
Andrew Rossignol2f489872018-04-27 13:16:35 -070027else
28COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED
29endif
Andrew Rossignola16406b2017-03-15 18:29:17 -070030
Andrew Rossignole969b9b2017-03-16 14:26:09 -070031# Place nanoapps in a namespace.
32COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
33
Andrew Rossignol816ef892017-10-17 17:40:05 -070034# Optional audio support.
Andrew Rossignol53fddb92018-05-04 10:40:31 -070035ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
Andrew Rossignol816ef892017-10-17 17:40:05 -070036COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED
37endif
38
Andrew Rossignol993e0262017-10-10 16:10:43 -070039# Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
40# Linux.
41CHRE_HOST_OS := $(shell uname)
42
Brian Duddieee0b9db2017-05-19 16:14:02 -070043ifeq ($(CHRE_PATCH_VERSION),)
Andrew Rossignol993e0262017-10-10 16:10:43 -070044ifeq ($(CHRE_HOST_OS),Darwin)
45DATE_CMD=gdate
46else
47DATE_CMD=date
48endif
49
Brian Duddieee0b9db2017-05-19 16:14:02 -070050# 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.
Andrew Rossignol993e0262017-10-10 16:10:43 -070054EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
55CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
Brian Duddieee0b9db2017-05-19 16:14:02 -070056endif
57
58COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
59
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080060# Makefile Includes ############################################################
61
Andrew Rossignolea139892017-04-05 12:57:15 -070062# Common includes.
Andrew Rossignolc410b4d2017-11-27 16:08:37 -080063include $(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
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080075
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.
Andrew Rossignol432a24e2017-10-27 14:43:37 -070079include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
Alexey Polyudovf8ade8e2018-04-18 18:31:32 -070080include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
Andrew Rossignol27126372017-02-23 11:50:18 -080081include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
82include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
Andrew Rossignole7d3b362017-08-08 14:39:00 -070083include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
Arthur Ishiguro50b092a2018-09-25 12:04:33 -070084include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk
85include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk
Meng-hsuan Chung6db8da02017-09-29 19:52:38 -070086include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
Meng-hsuan Chung425bd792018-04-09 17:45:25 -070087include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
Andrew Rossignold67589d2017-02-24 11:09:35 -080088include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
Andrew Rossignol388d81b2017-02-28 17:12:58 -080089include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk