• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Nanoapp Makefile
3#
4# Include this file in your nanoapp Makefile to produce binary nanoapps to
5# target a variety of architectures.
6#
7
8# Nanoapp Build Configuration Checks ###########################################
9
10ifeq ($(NANOAPP_NAME),)
11$(error "The NANOAPP_NAME variable must be set to the name of the nanoapp. \
12         This should be assigned by the Makefile that includes app.mk.")
13endif
14
15ifeq ($(NANOAPP_ID),)
16$(error "The NANOAPP_ID variable must be set to the ID of the nanoapp. \
17         This should be assigned by the Makefile that includes app.mk.")
18endif
19
20ifeq ($(NANOAPP_VERSION),)
21$(error "The NANOAPP_VERSION variable must be set to the version of the nanoapp. \
22         This should be assigned by the Makefile that includes app.mk.")
23endif
24
25ifeq ($(NANOAPP_NAME_STRING),)
26$(error "The NANOAPP_NAME_STRING variable must be set to the friendly name of \
27         the nanoapp. This should be assigned by the Makefile that includes \
28         app.mk.")
29endif
30
31ifeq ($(NANOAPP_VENDOR_STRING),)
32$(info "NANOAPP_VENDOR_STRING not supplied, defaulting to \"Google\".")
33NANOAPP_VENDOR_STRING = \"Google\"
34endif
35
36ifeq ($(NANOAPP_IS_SYSTEM_NANOAPP),)
37$(info "NANOAPP_IS_SYSTEM_NANOAPP not supplied, defaulting to 0.")
38NANOAPP_IS_SYSTEM_NANOAPP = 0
39endif
40
41ifeq ($(CHRE_PREFIX),)
42ifeq ($(ANDROID_BUILD_TOP),)
43$(error "You must run lunch, or specify an explicit CHRE_PREFIX environment \
44         variable")
45else
46CHRE_PREFIX = $(ANDROID_BUILD_TOP)/system/chre
47endif
48endif
49
50# Nanoapp Build ################################################################
51
52# This variable indicates to the variants that some post-processing may be
53# required as the target is a nanoapp.
54IS_NANOAPP_BUILD = true
55
56# Common App Build Configuration ###############################################
57
58OUTPUT_NAME = $(NANOAPP_NAME)
59
60# Common Compiler Flags ########################################################
61
62# Add the CHRE API to the include search path.
63COMMON_CFLAGS += -I$(CHRE_PREFIX)/chre_api/include/chre_api
64
65# Add util and platform/shared to the include search path.
66COMMON_CFLAGS += -I$(CHRE_PREFIX)/util/include
67COMMON_CFLAGS += -I$(CHRE_PREFIX)/platform/shared/include
68
69# Allows a nanoapp to know that is compiled separately from the CHRE system.
70COMMON_CFLAGS += -DCHRE_IS_NANOAPP_BUILD
71
72# Compile FlatBuffers in a portable way.
73COMMON_CFLAGS += -DFLATBUFFERS_CHRE
74
75# Nanoapp configuration flags.
76COMMON_CFLAGS += -DNANOAPP_ID=$(NANOAPP_ID)
77COMMON_CFLAGS += -DNANOAPP_VERSION=$(NANOAPP_VERSION)
78COMMON_CFLAGS += -DNANOAPP_VENDOR_STRING=$(NANOAPP_VENDOR_STRING)
79COMMON_CFLAGS += -DNANOAPP_NAME_STRING=$(NANOAPP_NAME_STRING)
80COMMON_CFLAGS += -DNANOAPP_IS_SYSTEM_NANOAPP=$(NANOAPP_IS_SYSTEM_NANOAPP)
81
82# Variant-specific Nanoapp Support Source Files ################################
83
84APP_SUPPORT_PATH = $(CHRE_PREFIX)/build/app_support
85DSO_SUPPORT_LIB_PATH = $(CHRE_PREFIX)/platform/shared/nanoapp
86DSO_SUPPORT_LIB_SRCS = $(DSO_SUPPORT_LIB_PATH)/nanoapp_support_lib_dso.cc
87
88GOOGLE_HEXAGONV60_SLPI_SRCS += $(DSO_SUPPORT_LIB_SRCS)
89GOOGLE_HEXAGONV62_SLPI_SRCS += $(DSO_SUPPORT_LIB_SRCS)
90GOOGLE_HEXAGONV62_SLPI-UIMG_SRCS += $(DSO_SUPPORT_LIB_SRCS)
91GOOGLE_HEXAGONV65_SLPI-SEE_SRCS += $(DSO_SUPPORT_LIB_SRCS)
92GOOGLE_HEXAGONV65_SLPI-SEE-UIMG_SRCS += $(DSO_SUPPORT_LIB_SRCS)
93GOOGLE_ARM64_ANDROID_SRCS += $(DSO_SUPPORT_LIB_SRCS)
94GOOGLE_X86_LINUX_SRCS += $(DSO_SUPPORT_LIB_SRCS)
95QCOM_HEXAGONV60_NANOHUB_SRCS += $(APP_SUPPORT_PATH)/qcom_nanohub/app_support.cc
96QCOM_HEXAGONV60_NANOHUB-UIMG_SRCS += $(APP_SUPPORT_PATH)/qcom_nanohub/app_support_uimg.cc
97
98# Makefile Includes ############################################################
99
100# Common includes
101include $(CHRE_PREFIX)/build/defs.mk
102include $(CHRE_PREFIX)/build/common.mk
103
104# CHRE API version.
105include $(CHRE_PREFIX)/chre_api/chre_api_version.mk
106
107# Supported variants includes
108include $(CHRE_PREFIX)/build/variant/google_arm64_android.mk
109include $(CHRE_PREFIX)/build/variant/google_cm4_nanohub.mk
110include $(CHRE_PREFIX)/build/variant/google_hexagonv55_slpi-see.mk
111include $(CHRE_PREFIX)/build/variant/google_hexagonv60_slpi.mk
112include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi.mk
113include $(CHRE_PREFIX)/build/variant/google_hexagonv62_slpi-uimg.mk
114include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see.mk
115include $(CHRE_PREFIX)/build/variant/google_hexagonv65_slpi-see-uimg.mk
116include $(CHRE_PREFIX)/build/variant/google_x86_linux.mk
117include $(CHRE_PREFIX)/build/variant/qcom_hexagonv60_nanohub.mk
118include $(CHRE_PREFIX)/build/variant/qcom_hexagonv60_nanohub-uimg.mk
119