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 | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 39 | # Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and |
| 40 | # Linux. |
| 41 | CHRE_HOST_OS := $(shell uname) |
| 42 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 43 | ifeq ($(CHRE_PATCH_VERSION),) |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 44 | ifeq ($(CHRE_HOST_OS),Darwin) |
| 45 | DATE_CMD=gdate |
| 46 | else |
| 47 | DATE_CMD=date |
| 48 | endif |
| 49 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 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. |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame] | 54 | EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s) |
| 55 | CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60)))) |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 56 | endif |
| 57 | |
| 58 | COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION) |
| 59 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 60 | # Makefile Includes ############################################################ |
| 61 | |
Andrew Rossignol | ea13989 | 2017-04-05 12:57:15 -0700 | [diff] [blame] | 62 | # Common includes. |
Andrew Rossignol | c410b4d | 2017-11-27 16:08:37 -0800 | [diff] [blame] | 63 | include $(CHRE_PREFIX)/build/defs.mk |
| 64 | include $(CHRE_PREFIX)/build/common.mk |
| 65 | |
| 66 | # CHRE Implementation includes. |
| 67 | include $(CHRE_PREFIX)/apps/apps.mk |
| 68 | include $(CHRE_PREFIX)/ash/ash.mk |
| 69 | include $(CHRE_PREFIX)/chre_api/chre_api.mk |
| 70 | include $(CHRE_PREFIX)/core/core.mk |
| 71 | include $(CHRE_PREFIX)/external/external.mk |
| 72 | include $(CHRE_PREFIX)/pal/pal.mk |
| 73 | include $(CHRE_PREFIX)/platform/platform.mk |
| 74 | include $(CHRE_PREFIX)/util/util.mk |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 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. |
Andrew Rossignol | 432a24e | 2017-10-27 14:43:37 -0700 | [diff] [blame] | 79 | include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk |
Alexey Polyudov | f8ade8e | 2018-04-18 18:31:32 -0700 | [diff] [blame] | 80 | include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk |
Andrew Rossignol | 2712637 | 2017-02-23 11:50:18 -0800 | [diff] [blame] | 81 | include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk |
| 82 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk |
Andrew Rossignol | e7d3b36 | 2017-08-08 14:39:00 -0700 | [diff] [blame] | 83 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk |
Arthur Ishiguro | 50b092a | 2018-09-25 12:04:33 -0700 | [diff] [blame^] | 84 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk |
| 85 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk |
Meng-hsuan Chung | 6db8da0 | 2017-09-29 19:52:38 -0700 | [diff] [blame] | 86 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk |
Meng-hsuan Chung | 425bd79 | 2018-04-09 17:45:25 -0700 | [diff] [blame] | 87 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk |
Andrew Rossignol | d67589d | 2017-02-24 11:09:35 -0800 | [diff] [blame] | 88 | include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk |
Andrew Rossignol | 388d81b | 2017-02-28 17:12:58 -0800 | [diff] [blame] | 89 | include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk |