Home | History | Annotate | Download | only in chre
      1 #
      2 # CHRE Makefile
      3 #
      4 
      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 
     11 # Variant Configuration ########################################################
     12 
     13 include $(CHRE_VARIANT_MK_INCLUDES)
     14 
     15 # Build Configuration ##########################################################
     16 
     17 OUTPUT_NAME = libchre
     18 
     19 # Compiler Flags ###############################################################
     20 
     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
     24 
     25 ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
     26 COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
     27 else
     28 COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED
     29 endif
     30 
     31 # Place nanoapps in a namespace.
     32 COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
     33 
     34 # Optional audio support.
     35 ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
     36 COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED
     37 endif
     38 
     39 # Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
     40 # Linux.
     41 CHRE_HOST_OS := $(shell uname)
     42 
     43 ifeq ($(CHRE_PATCH_VERSION),)
     44 ifeq ($(CHRE_HOST_OS),Darwin)
     45 DATE_CMD=gdate
     46 else
     47 DATE_CMD=date
     48 endif
     49 
     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.
     54 EPOCH=$(shell $(DATE_CMD) --date='2017-01-01' +%s)
     55 CHRE_PATCH_VERSION = $(shell echo $$(((`$(DATE_CMD) +%s` - $(EPOCH)) / (60 * 60))))
     56 endif
     57 
     58 COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
     59 
     60 # Makefile Includes ############################################################
     61 
     62 # Common includes.
     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
     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.
     79 include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
     80 include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
     81 include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
     82 include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
     83 include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
     84 include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
     85 include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
     86 include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
     87 include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk
     88