blob: ce8c5274298cfcfc4ba44aca7b2506808bd0fed9 [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 Rossignolebba0a22018-08-28 15:06:25 -070039# Optional GNSS support.
40ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
41COMMON_CFLAGS += -DCHRE_GNSS_SUPPORT_ENABLED
42endif
43
Andrew Rossignolc8cf82e2018-08-28 16:49:59 -070044# Optional Wi-Fi support.
45ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
46COMMON_CFLAGS += -DCHRE_WIFI_SUPPORT_ENABLED
47endif
48
Andrew Rossignol63c51da2018-08-29 11:06:20 -070049# Optional WWAN support.
50ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
51COMMON_CFLAGS += -DCHRE_WWAN_SUPPORT_ENABLED
52endif
53
Andrew Rossignol993e0262017-10-10 16:10:43 -070054# Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
55# Linux.
56CHRE_HOST_OS := $(shell uname)
57
Brian Duddieee0b9db2017-05-19 16:14:02 -070058ifeq ($(CHRE_PATCH_VERSION),)
Andrew Rossignol993e0262017-10-10 16:10:43 -070059ifeq ($(CHRE_HOST_OS),Darwin)
60DATE_CMD=gdate
61else
62DATE_CMD=date
63endif
64
Brian Duddieee0b9db2017-05-19 16:14:02 -070065# Compute the patch version as the number of hours since the start of some
66# arbitrary epoch. This will roll over 16 bits after ~7 years, but patch version
67# is scoped to the API version, so we can adjust the offset when a new API
68# version is released.
Andrew Rossignol993e0262017-10-10 16:10:43 -070069EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
70CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
Brian Duddieee0b9db2017-05-19 16:14:02 -070071endif
72
73COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
74
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080075# Makefile Includes ############################################################
76
Andrew Rossignolea139892017-04-05 12:57:15 -070077# Common includes.
Andrew Rossignolc410b4d2017-11-27 16:08:37 -080078include $(CHRE_PREFIX)/build/defs.mk
79include $(CHRE_PREFIX)/build/common.mk
80
81# CHRE Implementation includes.
82include $(CHRE_PREFIX)/apps/apps.mk
83include $(CHRE_PREFIX)/ash/ash.mk
84include $(CHRE_PREFIX)/chre_api/chre_api.mk
85include $(CHRE_PREFIX)/core/core.mk
86include $(CHRE_PREFIX)/external/external.mk
87include $(CHRE_PREFIX)/pal/pal.mk
88include $(CHRE_PREFIX)/platform/platform.mk
89include $(CHRE_PREFIX)/util/util.mk
Andrew Rossignolcb0ca9c2017-02-09 19:35:02 -080090
91# Supported Variants Includes. Not all CHRE variants are supported by this
92# implementation of CHRE. Example: this CHRE implementation is never built for
93# google_cm4_nanohub as Nanohub itself is a CHRE implementation.
Andrew Rossignol432a24e2017-10-27 14:43:37 -070094include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
Alexey Polyudov9135e472018-04-18 18:31:32 -070095include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
Andrew Rossignol27126372017-02-23 11:50:18 -080096include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
97include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
Andrew Rossignole7d3b362017-08-08 14:39:00 -070098include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
Arthur Ishiguro50b092a2018-09-25 12:04:33 -070099include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk
100include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk
Meng-hsuan Chung6db8da02017-09-29 19:52:38 -0700101include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
Meng-hsuan Chung425bd792018-04-09 17:45:25 -0700102include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
Arthur Ishiguroe1fbe7d2018-09-24 10:57:06 -0700103include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see.mk
Arthur Ishiguroaeca2cc2018-11-21 14:40:53 -0800104include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see-uimg.mk
Andrew Rossignold67589d2017-02-24 11:09:35 -0800105include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
Andrew Rossignol388d81b2017-02-28 17:12:58 -0800106include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk