Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #
  2. # CHRE Makefile
  3. #
  4. # Environment Setup ############################################################
  5. # Building CHRE is always done in-tree so the CHRE_PREFIX can be assigned to the
  6. # current directory.
  7. CHRE_PREFIX = .
  8. # Variant Configuration ########################################################
  9. include $(CHRE_VARIANT_MK_INCLUDES)
  10. # Build Configuration ##########################################################
  11. OUTPUT_NAME = libchre
  12. # Compiler Flags ###############################################################
  13. # Symbols required by the runtime for conditional compilation.
  14. COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
  15. COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
  16. COMMON_CFLAGS += -DCHRE_ENABLE_DEBUG_DUMP
  17. COMMON_CFLAGS += -DCHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
  18. ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
  19. COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
  20. else
  21. COMMON_CFLAGS += -DCHRE_ASSERTIONS_DISABLED
  22. endif
  23. # Place nanoapps in a namespace.
  24. COMMON_CFLAGS += -DCHRE_NANOAPP_INTERNAL
  25. # Optional audio support.
  26. ifeq ($(CHRE_AUDIO_SUPPORT_ENABLED), true)
  27. COMMON_CFLAGS += -DCHRE_AUDIO_SUPPORT_ENABLED
  28. endif
  29. # Optional GNSS support.
  30. ifeq ($(CHRE_GNSS_SUPPORT_ENABLED), true)
  31. COMMON_CFLAGS += -DCHRE_GNSS_SUPPORT_ENABLED
  32. endif
  33. # Optional Wi-Fi support.
  34. ifeq ($(CHRE_WIFI_SUPPORT_ENABLED), true)
  35. COMMON_CFLAGS += -DCHRE_WIFI_SUPPORT_ENABLED
  36. endif
  37. # Optional WWAN support.
  38. ifeq ($(CHRE_WWAN_SUPPORT_ENABLED), true)
  39. COMMON_CFLAGS += -DCHRE_WWAN_SUPPORT_ENABLED
  40. endif
  41. # Determine the CHRE_HOST_OS to resolve build discrepancies across Darwin and
  42. # Linux.
  43. CHRE_HOST_OS := $(shell uname)
  44. ifeq ($(CHRE_PATCH_VERSION),)
  45. ifeq ($(CHRE_HOST_OS),Darwin)
  46. DATE_CMD=gdate
  47. else
  48. DATE_CMD=date
  49. endif
  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. COMMON_CFLAGS += -DCHRE_PATCH_VERSION=$(CHRE_PATCH_VERSION)
  58. # Makefile Includes ############################################################
  59. # Common includes.
  60. include $(CHRE_PREFIX)/build/defs.mk
  61. include $(CHRE_PREFIX)/build/common.mk
  62. # CHRE Implementation includes.
  63. include $(CHRE_PREFIX)/apps/apps.mk
  64. include $(CHRE_PREFIX)/ash/ash.mk
  65. include $(CHRE_PREFIX)/chre_api/chre_api.mk
  66. include $(CHRE_PREFIX)/core/core.mk
  67. include $(CHRE_PREFIX)/external/external.mk
  68. include $(CHRE_PREFIX)/pal/pal.mk
  69. include $(CHRE_PREFIX)/platform/platform.mk
  70. include $(CHRE_PREFIX)/util/util.mk
  71. # Supported Variants Includes. Not all CHRE variants are supported by this
  72. # implementation of CHRE. Example: this CHRE implementation is never built for
  73. # google_cm4_nanohub as Nanohub itself is a CHRE implementation.
  74. include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
  75. include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
  76. include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
  77. include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
  78. include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
  79. include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see.mk
  80. include $(CHRE_PREFIX)/build/variant/google_hexagonv65_adsp-see-uimg.mk
  81. include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
  82. include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
  83. include $(CHRE_PREFIX)/build/variant/google_hexagonv66_adsp-see.mk
  84. include $(CHRE_PREFIX)/build/variant/google_hexagonv66_adsp-see-uimg.mk
  85. include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see.mk
  86. include $(CHRE_PREFIX)/build/variant/google_hexagonv66_slpi-see-uimg.mk
  87. include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
  88. include $(CHRE_PREFIX)/build/variant/google_x86_googletest.mk