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 | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 11 | # Build Configuration ########################################################## |
| 12 | |
| 13 | OUTPUT_NAME = libchre |
| 14 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 15 | # Compiler Flags ############################################################### |
| 16 | |
Andrew Rossignol | a16406b | 2017-03-15 18:29:17 -0700 | [diff] [blame] | 17 | # Symbols required by the runtime for conditional compilation. |
| 18 | COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG |
| 19 | COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG |
| 20 | COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED |
| 21 | |
Andrew Rossignol | e969b9b | 2017-03-16 14:26:09 -0700 | [diff] [blame] | 22 | # Place nanoapps in a namespace. |
| 23 | COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL |
| 24 | |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame^] | 25 | # Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and |
| 26 | # Linux. |
| 27 | CHRE_HOST_OS := $(shell uname) |
| 28 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 29 | ifeq ($(CHRE_PATCH_VERSION),) |
Andrew Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame^] | 30 | ifeq ($(CHRE_HOST_OS),Darwin) |
| 31 | DATE_CMD=gdate |
| 32 | else |
| 33 | DATE_CMD=date |
| 34 | endif |
| 35 | |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 36 | # 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 Rossignol | 993e026 | 2017-10-10 16:10:43 -0700 | [diff] [blame^] | 40 | EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s) |
| 41 | CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60)))) |
Brian Duddie | ee0b9db | 2017-05-19 16:14:02 -0700 | [diff] [blame] | 42 | endif |
| 43 | |
| 44 | COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION) |
| 45 | |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 46 | # Makefile Includes ############################################################ |
| 47 | |
Andrew Rossignol | ea13989 | 2017-04-05 12:57:15 -0700 | [diff] [blame] | 48 | # Variant-specific includes. |
| 49 | include $(CHRE_VARIANT_MK_INCLUDES) |
| 50 | |
| 51 | # CHRE Implementation includes. |
Andrew Rossignol | e969b9b | 2017-03-16 14:26:09 -0700 | [diff] [blame] | 52 | include apps/apps.mk |
Meng-hsuan Chung | c6ef3f6 | 2017-03-22 13:49:03 -0700 | [diff] [blame] | 53 | include ash/ash.mk |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 54 | include chre_api/chre_api.mk |
| 55 | include core/core.mk |
Andrew Rossignol | 388d81b | 2017-02-28 17:12:58 -0800 | [diff] [blame] | 56 | include external/external.mk |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 57 | include pal/pal.mk |
| 58 | include platform/platform.mk |
| 59 | include util/util.mk |
| 60 | |
Andrew Rossignol | ea13989 | 2017-04-05 12:57:15 -0700 | [diff] [blame] | 61 | # Common includes. |
Andrew Rossignol | cb0ca9c | 2017-02-09 19:35:02 -0800 | [diff] [blame] | 62 | include 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 Rossignol | 2712637 | 2017-02-23 11:50:18 -0800 | [diff] [blame] | 67 | include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk |
| 68 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk |
Andrew Rossignol | e7d3b36 | 2017-08-08 14:39:00 -0700 | [diff] [blame] | 69 | include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk |
Meng-hsuan Chung | 6db8da0 | 2017-09-29 19:52:38 -0700 | [diff] [blame] | 70 | include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk |
Andrew Rossignol | d67589d | 2017-02-24 11:09:35 -0800 | [diff] [blame] | 71 | include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk |
Andrew Rossignol | 388d81b | 2017-02-28 17:12:58 -0800 | [diff] [blame] | 72 | include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk |