Andrew Rossignol | 0d6761f | 2016-12-19 14:51:00 -0800 | [diff] [blame] | 1 | # |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 2 | # CHRE Makefile |
Andrew Rossignol | 0d6761f | 2016-12-19 14:51:00 -0800 | [diff] [blame] | 3 | # |
| 4 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 5 | # Environment Setup ############################################################ |
| 6 | |
| 7 | # Building CHRE is always done in-tree so the CHRE_PREFIX can be assigned to the |
| 8 | # current directory. |
| 9 | CHRE_PREFIX = . |
| 10 | |
Andrew Rossignol | 816ef89 | 2017-10-17 17:40:05 -0700 | [diff] [blame] | 11 | # Variant Configuration ######################################################## |
| 12 | |
| 13 | include $(CHRE_VARIANT_MK_INCLUDES) |
| 14 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 15 | # Build Configuration ########################################################## |
| 16 | |
| 17 | OUTPUT_NAME = libchre |
| 18 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 19 | # Compiler Flags ############################################################### |
| 20 | |
Andrew Rossignol | a16406b | 2017-03-15 18:29:17 -0700 | [diff] [blame] | 21 | # Symbols required by the runtime for conditional compilation. |
| 22 | COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG |
| 23 | COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG |
Andrew Rossignol | 2f48987 | 2018-04-27 13:16:35 -0700 | [diff] [blame] | 24 | |
| 25 | ifneq ($(CHRE_ASSERTIONS_ENABLED), false) |
Andrew Rossignol | a16406b | 2017-03-15 18:29:17 -0700 | [diff] [blame] | 26 | COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED |
Andrew Rossignol | 2f48987 | 2018-04-27 13:16:35 -0700 | [diff] [blame] | 27 | else |
| 28 | COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED |
| 29 | endif |
Andrew Rossignol | a16406b | 2017-03-15 18:29:17 -0700 | [diff] [blame] | 30 | |
Andrew Rossignol | e969b9b | 2017-03-16 14:26:09 -0700 | [diff] [blame] | 31 | # Place nanoapps in a namespace. |
| 32 | COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL |
| 33 | |
Andrew Rossignol | 816ef89 | 2017-10-17 17:40:05 -0700 | [diff] [blame] | 34 | # Optional audio support. |
Andrew Rossignol | 53fddb9 | 2018-05-04 10:40:31 -0700 | [diff] [blame] | 35 | ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true) |
Andrew Rossignol | 816ef89 | 2017-10-17 17:40:05 -0700 | [diff] [blame] | 36 | COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED |
| 37 | endif |
| 38 | |
Andrew Rossignol | ebba0a2 | 2018-08-28 15:06:25 -0700 | [diff] [blame] | 39 | # Optional GNSS support. |
| 40 | ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true) |
| 41 | COMMON_CFLAGS += -DCHRE_GNSS_SUPPORT_ENABLED |
| 42 | endif |
| 43 | |
Andrew Rossignol | c8cf82e | 2018-08-28 16:49:59 -0700 | [diff] [blame] | 44 | # Optional Wi-Fi support. |
| 45 | ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true) |
| 46 | COMMON_CFLAGS += -DCHRE_WIFI_SUPPORT_ENABLED |
| 47 | endif |
| 48 | |
Andrew Rossignol | 63c51da | 2018-08-29 11:06:20 -0700 | [diff] [blame] | 49 | # Optional WWAN support. |
| 50 | ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true) |
| 51 | COMMON_CFLAGS += -DCHRE_WWAN_SUPPORT_ENABLED |
| 52 | endif |
| 53 | |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 54 | # Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and |
| 55 | # Linux. |
| 56 | CHRE_HOST_OS := $(shell uname) |
| 57 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 58 | ifeq ($(CHRE_PATCH_VERSION),) |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 59 | ifeq ($(CHRE_HOST_OS),Darwin) |
| 60 | DATE_CMD=gdate |
| 61 | else |
| 62 | DATE_CMD=date |
| 63 | endif |
| 64 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 65 | # 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 Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 69 | EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s) |
| 70 | CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60)))) |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 71 | endif |
| 72 | |
| 73 | COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION) |
| 74 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 75 | # Makefile Includes ############################################################ |
| 76 | |
Andrew Rossignol | ea13989 | 2017-04-05 12:57:15 -0700 | [diff] [blame] | 77 | # Common includes. |
Andrew Rossignol | c410b4d | 2017-11-27 16:08:37 -0800 | [diff] [blame] | 78 | include $(CHRE_PREFIX)/build/defs.mk |
| 79 | include $(CHRE_PREFIX)/build/common.mk |
| 80 | |
| 81 | # CHRE Implementation includes. |
| 82 | include $(CHRE_PREFIX)/apps/apps.mk |
| 83 | include $(CHRE_PREFIX)/ash/ash.mk |
| 84 | include $(CHRE_PREFIX)/chre_api/chre_api.mk |
| 85 | include $(CHRE_PREFIX)/core/core.mk |
| 86 | include $(CHRE_PREFIX)/external/external.mk |
| 87 | include $(CHRE_PREFIX)/pal/pal.mk |
| 88 | include $(CHRE_PREFIX)/platform/platform.mk |
| 89 | include $(CHRE_PREFIX)/util/util.mk |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 90 | |
| 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 Rossignol | 432a24e | 2017-10-27 14:43:37 -0700 | [diff] [blame] | 94 | include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk |
Alexey Polyudov | 9135e47 | 2018-04-18 18:31:32 -0700 | [diff] [blame] | 95 | include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk |
Andrew Rossignol | 2712637 | 2017-02-23 11:50:18 -0800 | [diff] [blame] | 96 | include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk |
| 97 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk |
Andrew Rossignol | e7d3b36 | 2017-08-08 14:39:00 -0700 | [diff] [blame] | 98 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk |
Arthur Ishiguro | 50b092a | 2018-09-25 12:04:33 -0700 | [diff] [blame] | 99 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk |
| 100 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk |
Meng-hsuan Chung | 6db8da0 | 2017-09-29 19:52:38 -0700 | [diff] [blame] | 101 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk |
Meng-hsuan Chung | 425bd79 | 2018-04-09 17:45:25 -0700 | [diff] [blame] | 102 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk |
Arthur Ishiguro | e1fbe7d | 2018-09-24 10:57:06 -0700 | [diff] [blame] | 103 | include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see.mk |
Arthur Ishiguro | aeca2cc | 2018-11-21 14:40:53 -0800 | [diff] [blame] | 104 | include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see-uimg.mk |
Andrew Rossignol | d67589d | 2017-02-24 11:09:35 -0800 | [diff] [blame] | 105 | include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk |
Andrew Rossignol | 388d81b | 2017-02-28 17:12:58 -0800 | [diff] [blame] | 106 | include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk |